Back to godoc.org

Package serializer

v0.12.2
Latest Go to latest
Published: Jun 23, 2020 | License: MIT | Module: go.uber.org/cadence

Index

Package Files

Variables

var (
	// MissingBinaryEncodingVersion indicate that the encoding version is missing
	MissingBinaryEncodingVersion = &shared.BadRequestError{Message: "Missing binary encoding version."}
	// InvalidBinaryEncodingVersion indicate that the encoding version is incorrect
	InvalidBinaryEncodingVersion = &shared.BadRequestError{Message: "Invalid binary encoding version."}
	// MsgPayloadNotThriftEncoded indicate message is not thrift encoded
	MsgPayloadNotThriftEncoded = &shared.BadRequestError{Message: "Message payload is not thrift encoded."}
)

func Decode

func Decode(binary []byte, val ThriftObject) error

Decode decode the object

func DeserializeBatchEvents

func DeserializeBatchEvents(data *shared.DataBlob) ([]*shared.HistoryEvent, error)

DeserializeBatchEvents will deserialize blob data to history event data

func DeserializeBlobDataToHistoryEvents

func DeserializeBlobDataToHistoryEvents(
	dataBlobs []*shared.DataBlob, filterType shared.HistoryEventFilterType,
) (*shared.History, error)

DeserializeBlobDataToHistoryEvents deserialize the blob data to history event data

func Encode

func Encode(obj ThriftObject) ([]byte, error)

Encode encode the object

func NewDataBlob

func NewDataBlob(data []byte, encodingType shared.EncodingType) *shared.DataBlob

NewDataBlob creates new blob data

func SerializeBatchEvents

func SerializeBatchEvents(events []*shared.HistoryEvent, encodingType shared.EncodingType) (*shared.DataBlob, error)

SerializeBatchEvents will serialize history event data to blob data

type ThriftObject

type ThriftObject interface {
	FromWire(w wire.Value) error
	ToWire() (wire.Value, error)
}

ThriftObject represents a thrift object

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier