-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8d02ed4
commit 51fe3ea
Showing
77 changed files
with
15,445 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
#******************************************************************** | ||
# File: __init__.py | ||
# Author: Sam Strachan | ||
# | ||
# Description: | ||
# estreamer package | ||
# | ||
# Copyright (c) 2017 by Cisco Systems, Inc. | ||
# | ||
# ALL RIGHTS RESERVED. THESE SOURCE FILES ARE THE SOLE PROPERTY | ||
# OF CISCO SYSTEMS, Inc. AND CONTAIN CONFIDENTIAL AND PROPRIETARY | ||
# INFORMATION. REPRODUCTION OR DUPLICATION BY ANY MEANS OF ANY | ||
# PORTION OF THIS SOFTWARE WITHOUT PRIOR WRITTEN CONSENT OF | ||
# CISCO SYSTEMS, Inc. IS STRICTLY PROHIBITED. | ||
# | ||
#*********************************************************************/ | ||
|
||
# Version will get appended by the packager | ||
from estreamer.exception import EncoreException | ||
from estreamer.exception import TimeoutException | ||
from estreamer.exception import ParsingException | ||
from estreamer.exception import ConnectionClosedException | ||
from estreamer.exception import UnsupportedTimestampException | ||
from estreamer.exception import MessageErrorException | ||
from estreamer.bookmark import Bookmark | ||
from estreamer.connection import Connection | ||
from estreamer.crypto import Crypto | ||
from estreamer.settings import Settings | ||
from estreamer.hasher import Hasher | ||
from estreamer.diagnostics import Diagnostics | ||
from estreamer.monitor import Monitor | ||
from estreamer.service import Service | ||
from estreamer.configure import Configure | ||
from estreamer.pidfile import PidFile | ||
from estreamer.controller import Controller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
""" | ||
The adapters module contains various modules, classes | ||
and helpers which serialize to and from native dict | ||
objects to other types. There are base64, CSV, json | ||
and splunk adapters | ||
""" | ||
#******************************************************************** | ||
# File: __init__.py | ||
# Author: Sam Strachan | ||
# | ||
# Description: | ||
# adapters package | ||
# | ||
# Copyright (c) 2017 by Cisco Systems, Inc. | ||
# | ||
# ALL RIGHTS RESERVED. THESE SOURCE FILES ARE THE SOLE PROPERTY | ||
# OF CISCO SYSTEMS, Inc. AND CONTAIN CONFIDENTIAL AND PROPRIETARY | ||
# INFORMATION. REPRODUCTION OR DUPLICATION BY ANY MEANS OF ANY | ||
# PORTION OF THIS SOFTWARE WITHOUT PRIOR WRITTEN CONSENT OF | ||
# CISCO SYSTEMS, Inc. IS STRICTLY PROHIBITED. | ||
# | ||
#*********************************************************************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
"""Transforms to and from a base64 line and a dict""" | ||
#******************************************************************** | ||
# File: base64.py | ||
# Author: Sam Strachan | ||
# | ||
# Description: | ||
# Base64 adapter | ||
# | ||
# Copyright (c) 2017 by Cisco Systems, Inc. | ||
# | ||
# ALL RIGHTS RESERVED. THESE SOURCE FILES ARE THE SOLE PROPERTY | ||
# OF CISCO SYSTEMS, Inc. AND CONTAIN CONFIDENTIAL AND PROPRIETARY | ||
# INFORMATION. REPRODUCTION OR DUPLICATION BY ANY MEANS OF ANY | ||
# PORTION OF THIS SOFTWARE WITHOUT PRIOR WRITTEN CONSENT OF | ||
# CISCO SYSTEMS, Inc. IS STRICTLY PROHIBITED. | ||
# | ||
#*********************************************************************/ | ||
|
||
from __future__ import absolute_import | ||
|
||
import base64 | ||
import pickle | ||
import estreamer.crossprocesslogging as logging | ||
|
||
def loads( line ): | ||
"""Converts a pickled base64 line back into a dict""" | ||
byteArray = line.rstrip().decode('base64', 'strict') | ||
try: | ||
dictionary = pickle.loads( byteArray ) | ||
return dictionary | ||
except ValueError as ex: | ||
logging.getLogger(__name__).warning(ex) | ||
return None | ||
|
||
|
||
|
||
def dumps( data ): | ||
"""Serializes the incoming data as a pickled base64 string""" | ||
byteArray = pickle.dumps( data ) | ||
string = base64.b64encode( byteArray ) | ||
return string |
Oops, something went wrong.