jsonutils

package
v0.0.0-...-367b6cc Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ProtoJsonMarshalOptions = protojson.MarshalOptions{
		Indent:         "",
		AllowPartial:   true,
		UseEnumNumbers: false,
		UseProtoNames:  true,
	}
	ProtoJsonUnmarshalOptions = protojson.UnmarshalOptions{
		AllowPartial:   true,
		DiscardUnknown: true,
	}
)

Functions

func MarshalAnySlice

func MarshalAnySlice(anySlice []*anypb.Any) ([]byte, error)

func UnmarshalAnySlice

func UnmarshalAnySlice(data []byte) ([]*anypb.Any, error)

Types

type Generic

type Generic map[string]interface{}

func CastGeneric

func CastGeneric(source interface{}) Generic

func NewGeneric

func NewGeneric() Generic

func (Generic) Debug

func (g Generic) Debug()

func (Generic) Get

func (g Generic) Get(keys ...string) (value interface{})

func (Generic) Marshal

func (g Generic) Marshal() ([]byte, error)

func (Generic) MarshalProto

func (g Generic) MarshalProto(message protoreflect.ProtoMessage) error

func (Generic) MarshalReader

func (g Generic) MarshalReader() (io.Reader, error)

func (Generic) Set

func (g Generic) Set(key string, value interface{}) Generic

func (Generic) Unmarshal

func (g Generic) Unmarshal(data []byte) error

func (Generic) UnmarshalProto

func (g Generic) UnmarshalProto(message protoreflect.ProtoMessage) error

func (Generic) UnmarshalReader

func (g Generic) UnmarshalReader(reader io.Reader) error

Jump to

Keyboard shortcuts

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