Package protox contains utilities for working with protobufs.



This section is empty.


This section is empty.


func DecodeBase64

func DecodeBase64(data string, ret proto.Message) error

DecodeBase64 decodes a base64 wrapped proto.

func EncodeBase64

func EncodeBase64(msg proto.Message) (string, error)

EncodeBase64 encodes a proto wrapped in base64.

func MustEncode

func MustEncode(msg proto.Message) []byte

MustEncode encode the message and panics on failure.

func MustEncodeBase64

func MustEncodeBase64(msg proto.Message) string

MustEncodeBase64 encodes a proto wrapped in base64 and panics on failure.

func PackBase64Proto

func PackBase64Proto(in proto.Message) (*protobuf.Any, error)

PackBase64Proto encodes a proto message into a base64-encoded BytesValue message.

func PackBytes

func PackBytes(in []byte) (*protobuf.Any, error)

PackBytes applies a BytesValue wrapper to the supplied bytes.

func PackProto

func PackProto(in proto.Message) (*protobuf.Any, error)

PackProto encodes a proto message and wraps into a BytesValue.

func Unpack

func Unpack(data *protobuf.Any, url string, ret proto.Message) error

Unpack decodes a proto.

func UnpackBase64Proto

func UnpackBase64Proto(data *protobuf.Any, ret proto.Message) error

UnpackBase64Proto decodes a BytesValue + base64 wrapped proto.

func UnpackBytes

func UnpackBytes(data *protobuf.Any) ([]byte, error)

UnpackBytes removes the BytesValue wrapper.

func UnpackProto

func UnpackProto(data *protobuf.Any, ret proto.Message) error

UnpackProto decodes a BytesValue wrapped proto.


This section is empty.