Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProtoMarshalJSON ¶
ProtoMarshalJSON provides an auxiliary function to return Proto3 JSON encoded bytes of a message.
Types ¶
type ProtoCodec ¶
ProtoCodec that omits empty values. This Marshaler can be used globally when setting up the client context or individually for each command via `clientCtx.WithJSONMarshaler(myMarshaler)`.
func NewProtoCodec ¶
func NewProtoCodec(marshaler codec.Codec, registry types.InterfaceRegistry) *ProtoCodec
func (*ProtoCodec) MarshalInterfaceJSON ¶
func (pc *ProtoCodec) MarshalInterfaceJSON(x proto.Message) ([]byte, error)
MarshalInterfaceJSON is a convenience function for proto marshalling interfaces. It packs the provided value in an Any and then marshals it to bytes. NOTE: to marshal a concrete type, you should use MarshalJSON instead
func (*ProtoCodec) MarshalJSON ¶
func (pc *ProtoCodec) MarshalJSON(o proto.Message) ([]byte, error)
MarshalJSON implements JSONMarshaler.MarshalJSON method, it marshals to JSON using proto codec.
func (*ProtoCodec) MustMarshalJSON ¶
func (pc *ProtoCodec) MustMarshalJSON(o proto.Message) []byte
MustMarshalJSON implements JSONMarshaler.MustMarshalJSON method, it executes MarshalJSON except it panics upon failure.