Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
skhademcis authored Sep 28, 2020
1 parent 8d02ed4 commit 51fe3ea
Show file tree
Hide file tree
Showing 77 changed files with 15,445 additions and 0 deletions.
36 changes: 36 additions & 0 deletions estreamer/__init__.py
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
22 changes: 22 additions & 0 deletions estreamer/adapters/__init__.py
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.
#
#*********************************************************************/
41 changes: 41 additions & 0 deletions estreamer/adapters/base64.py
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
Loading

0 comments on commit 51fe3ea

Please sign in to comment.