Learn more  » Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

edgify / rook   python

Repository URL to install this package:

Version: 0.1.176 

/ com_ws / envelope_wrappers / i_envelope_wrapper.py

from abc import ABCMeta, abstractmethod

import rook.protobuf.envelope_pb2 as envelope_pb


class IEnvelopeWrapper:
    __metaclass__ = ABCMeta

    @abstractmethod
    def get_buffer(self):
        pass

    @abstractmethod
    def __len__(self):
        pass

    @staticmethod
    def get_serialized_envelope(message):
        envelope = envelope_pb.Envelope()
        envelope.timestamp.GetCurrentTime()
        envelope.msg.Pack(message)

        return envelope.SerializeToString()