codec

package
v1.22.2-rc3 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: MIT Imports: 5 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONPBEncoder added in v0.27.0

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 added in v0.27.0

func NewJSONPBEncoder() *JSONPBEncoder

NewJSONPBEncoder creates a new JSONPBEncoder.

func NewJSONPBIndentEncoder added in v0.27.0

func NewJSONPBIndentEncoder(indent string) *JSONPBEncoder

NewJSONPBIndentEncoder creates a new JSONPBEncoder with indent.

func (*JSONPBEncoder) Decode added in v0.27.0

func (e *JSONPBEncoder) Decode(data []byte, pb proto.Message) error

Decode bytes to protobuf struct.

func (*JSONPBEncoder) DecodeHistories added in v0.27.0

func (e *JSONPBEncoder) DecodeHistories(data []byte) ([]*historypb.History, error)

Decode History slice from bytes.

func (*JSONPBEncoder) DecodeHistoryEvents added in v0.27.0

func (e *JSONPBEncoder) DecodeHistoryEvents(data []byte) ([]*historypb.HistoryEvent, error)

Decode HistoryEvent slice from bytes.

func (*JSONPBEncoder) Encode added in v0.27.0

func (e *JSONPBEncoder) Encode(pb proto.Message) ([]byte, error)

Encode protobuf struct to bytes.

func (*JSONPBEncoder) EncodeHistories added in v0.27.0

func (e *JSONPBEncoder) EncodeHistories(histories []*historypb.History) ([]byte, error)

Encode History slice to bytes.

func (*JSONPBEncoder) EncodeHistoryEvents added in v0.27.0

func (e *JSONPBEncoder) EncodeHistoryEvents(historyEvents []*historypb.HistoryEvent) ([]byte, error)

Encode HistoryEvent slice to bytes.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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