Documentation

Index

Constants

View Source
const (
	V0 Version = 0
	V1         = 1
	V2         = 2
	V3         = 3
)
View Source
const EncodingOffset int = 2
View Source
const EnvelopeOffset int = 2

Variables

This section is empty.

Functions

func MarshalEnvelope

func MarshalEnvelope(model Model) ([]byte, error)

func MarshalProto

func MarshalProto(v Model) ([]byte, error)

func UnmarshalEnvelope

func UnmarshalEnvelope(logger lager.Logger, unencodedPayload []byte, model Model) error

func UnmarshalProto

func UnmarshalProto(logger lager.Logger, marshaledPayload []byte, model Model) error

Types

type Encoder

type Encoder interface {
	Encode(payload []byte) ([]byte, error)
	Decode(payload []byte) ([]byte, error)
}

func NewEncoder

func NewEncoder(cryptor encryption.Cryptor) Encoder

type Encoding

type Encoding [EncodingOffset]byte
var (
	BASE64_ENCRYPTED Encoding = [2]byte{'0', '2'}
)

type EnvelopeFormat

type EnvelopeFormat byte
const (
	PROTO EnvelopeFormat = 2
)

type Model

type Model interface {
	proto.Message
}

type Serializer

type Serializer interface {
	Marshal(logger lager.Logger, model Model) ([]byte, error)
	Unmarshal(logger lager.Logger, encodedPayload []byte, model Model) error
}

func NewSerializer

func NewSerializer(cryptor encryption.Cryptor) Serializer

type Version

type Version byte