utils

package
v0.5.53 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2021 License: Apache-2.0 Imports: 6 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(s []string, e string) bool

func CopyMap

func CopyMap(o map[string]string) (r map[string]string)

func MarshalObjToStruct

func MarshalObjToStruct(input interface{}) (*structpb.Struct, error)

TODO: Use the stdlib version in the future, or move there if not there. Don't use this if input is a proto Message.

func MarshalStruct

func MarshalStruct(in proto.Message, out *structpb.Struct) error

func MarshalToString

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

func UnionMaps

func UnionMaps(maps ...map[string]string) map[string]string

This function unions a list of maps (each can be nil or populated) by allocating a new map. Conflicting keys will always defer to the later input map's corresponding value.

func UnmarshalStruct

func UnmarshalStruct(structObj *structpb.Struct, msg proto.Message) error

func UnmarshalStructToObj added in v0.5.33

func UnmarshalStructToObj(structObj *structpb.Struct, obj interface{}) error

Don't use this if the unmarshalled obj is a proto message.

Types

type ErrorCollection added in v0.5.29

type ErrorCollection struct {
	Errors []error
}

func (ErrorCollection) Error added in v0.5.29

func (e ErrorCollection) Error() string

Jump to

Keyboard shortcuts

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