Documentation ¶
Index ¶
- func DeserializeBatchEvents(data *commonpb.DataBlob) ([]*historypb.HistoryEvent, error)
- func DeserializeBlobDataToHistoryEvents(dataBlobs []*commonpb.DataBlob, filterType enumspb.HistoryEventFilterType) (*historypb.History, error)
- func NewDataBlob(data []byte, encodingType enumspb.EncodingType) *commonpb.DataBlob
- func NewUnknownEncodingTypeError(encodingType enumspb.EncodingType) error
- func SerializeBatchEvents(events []*historypb.HistoryEvent, encodingType enumspb.EncodingType) (*commonpb.DataBlob, error)
- type DeserializationError
- type EncodingType
- type JSONPBEncoder
- type SerializationError
- type UnknownEncodingTypeError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeserializeBatchEvents ¶
func DeserializeBatchEvents(data *commonpb.DataBlob) ([]*historypb.HistoryEvent, error)
DeserializeBatchEvents deserializes batch events from a datablob proto
func DeserializeBlobDataToHistoryEvents ¶
func DeserializeBlobDataToHistoryEvents( dataBlobs []*commonpb.DataBlob, filterType enumspb.HistoryEventFilterType, ) (*historypb.History, error)
DeserializeBlobDataToHistoryEvents deserialize the blob data to history event data
func NewDataBlob ¶
func NewDataBlob(data []byte, encodingType enumspb.EncodingType) *commonpb.DataBlob
NewDataBlob creates new blob data
func NewUnknownEncodingTypeError ¶
func NewUnknownEncodingTypeError(encodingType enumspb.EncodingType) error
NewUnknownEncodingTypeError returns a new instance of encoding type error
func SerializeBatchEvents ¶
func SerializeBatchEvents(events []*historypb.HistoryEvent, encodingType enumspb.EncodingType) (*commonpb.DataBlob, error)
SerializeBatchEvents serializes batch events into a datablob proto
Types ¶
type DeserializationError ¶
type DeserializationError struct {
// contains filtered or unexported fields
}
DeserializationError is an error type for deserialization
func NewDeserializationError ¶
func NewDeserializationError(msg string) *DeserializationError
NewDeserializationError returns a DeserializationError
func (*DeserializationError) Error ¶
func (e *DeserializationError) Error() string
type EncodingType ¶
type EncodingType string
EncodingType is an enum that represents various data encoding types
const ( // todo: Deprecate and use protoEncodingEnum.ToString() EncodingTypeJSON EncodingType = "json" EncodingTypeGob EncodingType = "gob" EncodingTypeUnknown EncodingType = "unknow" EncodingTypeEmpty EncodingType = "" EncodingTypeProto3 EncodingType = "proto3" )
Data encoding types
func (EncodingType) String ¶
func (e EncodingType) String() string
type JSONPBEncoder ¶
type JSONPBEncoder struct {
// contains filtered or unexported fields
}
JSONPBEncoder is JSON encoder/decoder for protobuf structs and slices of protobuf structs. This is an wrapper on top of jsonpb.Marshaler which supports not only single object serialization but also slices of concrete objects.
func NewJSONPBEncoder ¶
func NewJSONPBEncoder() *JSONPBEncoder
NewJSONPBEncoder creates a new JSONPBEncoder.
func NewJSONPBIndentEncoder ¶
func NewJSONPBIndentEncoder(indent string) *JSONPBEncoder
NewJSONPBIndentEncoder creates a new JSONPBEncoder with indent.
type SerializationError ¶
type SerializationError struct {
// contains filtered or unexported fields
}
SerializationError is an error type for serialization
func NewSerializationError ¶
func NewSerializationError(msg string) *SerializationError
NewSerializationError returns a SerializationError
func (*SerializationError) Error ¶
func (e *SerializationError) Error() string
type UnknownEncodingTypeError ¶
type UnknownEncodingTypeError struct {
// contains filtered or unexported fields
}
UnknownEncodingTypeError is an error type for unknown or unsupported encoding type
func (*UnknownEncodingTypeError) Error ¶
func (e *UnknownEncodingTypeError) Error() string