minos.common.protocol.abc module

class minos.common.protocol.abc.MinosBinaryProtocol[source]

Bases: abc.ABC

Minos binary encoder / decoder interface.

abstract classmethod decode(data, *args, **kwargs)[source]

Decodes the given bytes data.

Parameters

data (bytes) – bytes data to be decoded.

Return type

typing.Any

Returns

De decoded data.

abstract classmethod encode(*args, **kwargs)[source]

Encodes the given value into bytes.

Parameters
  • args – Additional positional arguments.

  • kwargs – Additional named arguments.

Return type

bytes

Returns

A bytes instance.