format

package
v0.0.0-...-a7ed0dc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 5 Imported by: 18

Documentation

Index

Constants

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
const (
	V0 Version = 0
	V1 Version = 1
	V2 Version = 2
	V3 Version = 3
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL