protox

package
v2.31.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: Apache-2.0, BSD-3-Clause, MIT Imports: 5 Imported by: 0

Documentation

Overview

Package protox contains utilities for working with protobufs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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