serializer

package
v2.0.0-...-1574041 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// MissingBinaryEncodingVersion indicate that the encoding version is missing
	MissingBinaryEncodingVersion = &api.BadRequestError{Message: "Missing binary encoding version."}
	// InvalidBinaryEncodingVersion indicate that the encoding version is incorrect
	InvalidBinaryEncodingVersion = &api.BadRequestError{Message: "Invalid binary encoding version."}
	// MsgPayloadNotThriftEncoded indicate message is not thrift encoded
	MsgPayloadNotThriftEncoded = &api.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 *apiv1.DataBlob) ([]*apiv1.HistoryEvent, error)

DeserializeBatchEvents will deserialize blob data to history event data

func DeserializeBlobDataToHistoryEvents

func DeserializeBlobDataToHistoryEvents(
	dataBlobs []*apiv1.DataBlob, filterType apiv1.EventFilterType,
) (*apiv1.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 apiv1.EncodingType) *apiv1.DataBlob

NewDataBlob creates new blob data

func SerializeBatchEvents

func SerializeBatchEvents(events []*apiv1.HistoryEvent, encodingType apiv1.EncodingType) (*apiv1.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
y or Y : Canonical URL