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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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