serializer

package
Version: v0.18.2 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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."}
)

Functions

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

Types

type ThriftObject

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

ThriftObject represents a thrift object

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL