utils

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BigEndianToUint32

func BigEndianToUint32(bz []byte) uint32

BigEndianToUint32 returns an uint32 from big endian encoded bytes. If encoding is empty, zero is returned.

func MarshalJSONAny

func MarshalJSONAny(m codec.JSONMarshaler, msg proto.Message) ([]byte, error)

MarshalJSONAny is a convenience function for packing the provided value in an Any and then proto marshaling it to bytes

func MustMarshalJSONAny

func MustMarshalJSONAny(m codec.JSONMarshaler, msg proto.Message) []byte

MustMarshalJSONAny is a convenience function for packing the provided value in an Any and then proto marshaling it to bytes

func MustUnmarshalJSONAny

func MustUnmarshalJSONAny(m codec.Marshaler, iface interface{}, bz []byte)

MustUnmarshalJSONAny is a convenience function for proto unmarshaling an Any from bz and then unpacking it to the interface pointer passed in as iface using the provided AnyUnpacker or panics

func Uint32ToBigEndian

func Uint32ToBigEndian(i uint32) []byte

Uint32ToBigEndian - marshals uint32 to a bigendian byte slice so it can be sorted

func UnmarshalJSONAny

func UnmarshalJSONAny(m codec.Marshaler, iface interface{}, bz []byte) error

UnmarshalJSONAny is a convenience function for proto unmarshaling an Any from bz and then unpacking it to the interface pointer passed in as iface using the provided AnyUnpacker or returning an error

Ex:

var x MyInterface
err := UnmarshalJSONAny(unpacker, &x, bz)

Types

This section is empty.

Jump to

Keyboard shortcuts

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