Documentation ¶
Index ¶
- func MarshalAny(m Marshaler, x interface{}) ([]byte, error)
- func MarshalIndentFromJSON(bz []byte) ([]byte, error)
- func MarshalJSONIndent(m JSONMarshaler, obj interface{}) ([]byte, error)
- func MustMarshalJSONIndent(m JSONMarshaler, obj interface{}) []byte
- func ProtoMarshalJSON(msg proto.Message) ([]byte, error)
- func ProtoMarshalJSONIndent(msg proto.Message) ([]byte, error)
- func RegisterCrypto(cdc *Codec)
- func RegisterEvidences(cdc *Codec)
- func UnmarshalAny(m Marshaler, iface interface{}, bz []byte) error
- type AminoCodec
- func (ac *AminoCodec) MarshalBinaryBare(o ProtoMarshaler) ([]byte, error)
- func (ac *AminoCodec) MarshalBinaryLengthPrefixed(o ProtoMarshaler) ([]byte, error)
- func (ac *AminoCodec) MustMarshalBinaryBare(o ProtoMarshaler) []byte
- func (ac *AminoCodec) MustMarshalBinaryLengthPrefixed(o ProtoMarshaler) []byte
- func (ac *AminoCodec) MustUnmarshalBinaryBare(bz []byte, ptr ProtoMarshaler)
- func (ac *AminoCodec) MustUnmarshalBinaryLengthPrefixed(bz []byte, ptr ProtoMarshaler)
- func (ac *AminoCodec) UnmarshalBinaryBare(bz []byte, ptr ProtoMarshaler) error
- func (ac *AminoCodec) UnmarshalBinaryLengthPrefixed(bz []byte, ptr ProtoMarshaler) error
- type Codec
- func (cdc *Codec) MarshalBinaryBare(o interface{}) ([]byte, error)
- func (cdc *Codec) MarshalBinaryLengthPrefixed(o interface{}) ([]byte, error)
- func (cdc *Codec) MarshalJSON(o interface{}) ([]byte, error)
- func (cdc *Codec) MarshalJSONIndent(o interface{}, prefix, indent string) ([]byte, error)
- func (cdc *Codec) MustMarshalBinaryBare(o interface{}) []byte
- func (cdc *Codec) MustMarshalBinaryLengthPrefixed(o interface{}) []byte
- func (cdc *Codec) MustMarshalJSON(o interface{}) []byte
- func (cdc *Codec) MustUnmarshalBinaryBare(bz []byte, ptr interface{})
- func (cdc *Codec) MustUnmarshalBinaryLengthPrefixed(bz []byte, ptr interface{})
- func (cdc *Codec) MustUnmarshalJSON(bz []byte, ptr interface{})
- func (cdc *Codec) RegisterConcrete(o interface{}, name string, copts *amino.ConcreteOptions)
- func (cdc *Codec) RegisterInterface(ptr interface{}, iopts *amino.InterfaceOptions)
- func (cdc *Codec) Seal()
- func (cdc *Codec) UnmarshalBinaryBare(bz []byte, ptr interface{}) error
- func (cdc *Codec) UnmarshalBinaryLengthPrefixed(bz []byte, ptr interface{}) error
- func (cdc *Codec) UnmarshalJSON(bz []byte, ptr interface{}) error
- func (*Codec) UnpackAny(*types.Any, interface{}) error
- type HybridCodec
- func (hc *HybridCodec) MarshalBinaryBare(o ProtoMarshaler) ([]byte, error)
- func (hc *HybridCodec) MarshalBinaryLengthPrefixed(o ProtoMarshaler) ([]byte, error)
- func (hc *HybridCodec) MarshalJSON(o interface{}) ([]byte, error)
- func (hc *HybridCodec) MustMarshalBinaryBare(o ProtoMarshaler) []byte
- func (hc *HybridCodec) MustMarshalBinaryLengthPrefixed(o ProtoMarshaler) []byte
- func (hc *HybridCodec) MustMarshalJSON(o interface{}) []byte
- func (hc *HybridCodec) MustUnmarshalBinaryBare(bz []byte, ptr ProtoMarshaler)
- func (hc *HybridCodec) MustUnmarshalBinaryLengthPrefixed(bz []byte, ptr ProtoMarshaler)
- func (hc *HybridCodec) MustUnmarshalJSON(bz []byte, ptr interface{})
- func (hc *HybridCodec) UnmarshalBinaryBare(bz []byte, ptr ProtoMarshaler) error
- func (hc *HybridCodec) UnmarshalBinaryLengthPrefixed(bz []byte, ptr ProtoMarshaler) error
- func (hc *HybridCodec) UnmarshalJSON(bz []byte, ptr interface{}) error
- func (hc *HybridCodec) UnpackAny(any *types.Any, iface interface{}) error
- type ProtoCodec
- func (pc *ProtoCodec) MarshalBinaryBare(o ProtoMarshaler) ([]byte, error)
- func (pc *ProtoCodec) MarshalBinaryLengthPrefixed(o ProtoMarshaler) ([]byte, error)
- func (pc *ProtoCodec) MarshalJSON(o interface{}) ([]byte, error)
- func (pc *ProtoCodec) MustMarshalBinaryBare(o ProtoMarshaler) []byte
- func (pc *ProtoCodec) MustMarshalBinaryLengthPrefixed(o ProtoMarshaler) []byte
- func (pc *ProtoCodec) MustMarshalJSON(o interface{}) []byte
- func (pc *ProtoCodec) MustUnmarshalBinaryBare(bz []byte, ptr ProtoMarshaler)
- func (pc *ProtoCodec) MustUnmarshalBinaryLengthPrefixed(bz []byte, ptr ProtoMarshaler)
- func (pc *ProtoCodec) MustUnmarshalJSON(bz []byte, ptr interface{})
- func (pc *ProtoCodec) UnmarshalBinaryBare(bz []byte, ptr ProtoMarshaler) error
- func (pc *ProtoCodec) UnmarshalBinaryLengthPrefixed(bz []byte, ptr ProtoMarshaler) error
- func (pc *ProtoCodec) UnmarshalJSON(bz []byte, ptr interface{}) error
- func (pc *ProtoCodec) UnpackAny(any *types.Any, iface interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalAny ¶
MarshalAny is a convenience function for packing the provided value in an Any and then proto marshaling it to bytes
func MarshalIndentFromJSON ¶
MarshalIndentFromJSON returns indented JSON-encoded bytes from already encoded JSON bytes. The output encoding will adhere to the original input's encoding (e.g. Proto3).
func MarshalJSONIndent ¶
MarshalJSONIndent provides a utility for indented JSON encoding of an object via an Amino codec. It returns an error if it cannot serialize or indent as JSON.
func MustMarshalJSONIndent ¶
func MustMarshalJSONIndent(m JSONMarshaler, obj interface{}) []byte
MustMarshalJSONIndent executes MarshalJSONIndent except it panics upon failure.
func ProtoMarshalJSON ¶
ProtoMarshalJSON provides an auxiliary function to return Proto3 JSON encoded bytes of a message.
func ProtoMarshalJSONIndent ¶
ProtoMarshalJSONIndent provides an auxiliary function to return Proto3 indented JSON encoded bytes of a message.
func RegisterCrypto ¶
func RegisterCrypto(cdc *Codec)
RegisterCrypto registers all crypto dependency types with the provided Amino codec.
func RegisterEvidences ¶
func RegisterEvidences(cdc *Codec)
RegisterEvidences registers Tendermint evidence types with the provided Amino codec.
func UnmarshalAny ¶
UnmarshalAny 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 := UnmarshalAny(unpacker, &x, bz)
Types ¶
type AminoCodec ¶
type AminoCodec struct {
*Codec
}
AminoCodec defines a codec that utilizes Codec for both binary and JSON encoding.
func NewAminoCodec ¶
func NewAminoCodec(codec *Codec) *AminoCodec
func (*AminoCodec) MarshalBinaryBare ¶
func (ac *AminoCodec) MarshalBinaryBare(o ProtoMarshaler) ([]byte, error)
func (*AminoCodec) MarshalBinaryLengthPrefixed ¶
func (ac *AminoCodec) MarshalBinaryLengthPrefixed(o ProtoMarshaler) ([]byte, error)
func (*AminoCodec) MustMarshalBinaryBare ¶
func (ac *AminoCodec) MustMarshalBinaryBare(o ProtoMarshaler) []byte
func (*AminoCodec) MustMarshalBinaryLengthPrefixed ¶
func (ac *AminoCodec) MustMarshalBinaryLengthPrefixed(o ProtoMarshaler) []byte
func (*AminoCodec) MustUnmarshalBinaryBare ¶
func (ac *AminoCodec) MustUnmarshalBinaryBare(bz []byte, ptr ProtoMarshaler)
func (*AminoCodec) MustUnmarshalBinaryLengthPrefixed ¶
func (ac *AminoCodec) MustUnmarshalBinaryLengthPrefixed(bz []byte, ptr ProtoMarshaler)
func (*AminoCodec) UnmarshalBinaryBare ¶
func (ac *AminoCodec) UnmarshalBinaryBare(bz []byte, ptr ProtoMarshaler) error
func (*AminoCodec) UnmarshalBinaryLengthPrefixed ¶
func (ac *AminoCodec) UnmarshalBinaryLengthPrefixed(bz []byte, ptr ProtoMarshaler) error
type Codec ¶
amino codec to marshal/unmarshal
var Cdc *Codec
Cdc defines a global generic sealed Amino codec to be used throughout sdk. It has all Tendermint crypto and evidence types registered.
TODO: Consider removing this global.
var Cdc *Codec
Cdc generic sealed codec to be used throughout sdk
func (*Codec) MarshalBinaryBare ¶
func (*Codec) MarshalBinaryLengthPrefixed ¶
func (*Codec) MarshalJSON ¶
func (*Codec) MarshalJSONIndent ¶
func (*Codec) MustMarshalBinaryBare ¶
func (cdc *Codec) MustMarshalBinaryBare(o interface{}) []byte
func (*Codec) MustMarshalBinaryLengthPrefixed ¶
func (cdc *Codec) MustMarshalBinaryLengthPrefixed(o interface{}) []byte
func (*Codec) MustMarshalJSON ¶
func (cdc *Codec) MustMarshalJSON(o interface{}) []byte
func (*Codec) MustUnmarshalBinaryBare ¶
func (cdc *Codec) MustUnmarshalBinaryBare(bz []byte, ptr interface{})
func (*Codec) MustUnmarshalBinaryLengthPrefixed ¶
func (cdc *Codec) MustUnmarshalBinaryLengthPrefixed(bz []byte, ptr interface{})
func (*Codec) MustUnmarshalJSON ¶
func (cdc *Codec) MustUnmarshalJSON(bz []byte, ptr interface{})
func (*Codec) RegisterConcrete ¶
func (cdc *Codec) RegisterConcrete(o interface{}, name string, copts *amino.ConcreteOptions)
func (*Codec) RegisterInterface ¶
func (cdc *Codec) RegisterInterface(ptr interface{}, iopts *amino.InterfaceOptions)
func (*Codec) UnmarshalBinaryBare ¶
func (*Codec) UnmarshalBinaryLengthPrefixed ¶
func (*Codec) UnmarshalJSON ¶
type HybridCodec ¶
type HybridCodec struct {
// contains filtered or unexported fields
}
HybridCodec defines a codec that utilizes Protobuf for binary encoding and Amino for JSON encoding.
func (*HybridCodec) MarshalBinaryBare ¶
func (hc *HybridCodec) MarshalBinaryBare(o ProtoMarshaler) ([]byte, error)
func (*HybridCodec) MarshalBinaryLengthPrefixed ¶
func (hc *HybridCodec) MarshalBinaryLengthPrefixed(o ProtoMarshaler) ([]byte, error)
func (*HybridCodec) MarshalJSON ¶
func (hc *HybridCodec) MarshalJSON(o interface{}) ([]byte, error)
func (*HybridCodec) MustMarshalBinaryBare ¶
func (hc *HybridCodec) MustMarshalBinaryBare(o ProtoMarshaler) []byte
func (*HybridCodec) MustMarshalBinaryLengthPrefixed ¶
func (hc *HybridCodec) MustMarshalBinaryLengthPrefixed(o ProtoMarshaler) []byte
func (*HybridCodec) MustMarshalJSON ¶
func (hc *HybridCodec) MustMarshalJSON(o interface{}) []byte
func (*HybridCodec) MustUnmarshalBinaryBare ¶
func (hc *HybridCodec) MustUnmarshalBinaryBare(bz []byte, ptr ProtoMarshaler)
func (*HybridCodec) MustUnmarshalBinaryLengthPrefixed ¶
func (hc *HybridCodec) MustUnmarshalBinaryLengthPrefixed(bz []byte, ptr ProtoMarshaler)
func (*HybridCodec) MustUnmarshalJSON ¶
func (hc *HybridCodec) MustUnmarshalJSON(bz []byte, ptr interface{})
func (*HybridCodec) UnmarshalBinaryBare ¶
func (hc *HybridCodec) UnmarshalBinaryBare(bz []byte, ptr ProtoMarshaler) error
func (*HybridCodec) UnmarshalBinaryLengthPrefixed ¶
func (hc *HybridCodec) UnmarshalBinaryLengthPrefixed(bz []byte, ptr ProtoMarshaler) error
func (*HybridCodec) UnmarshalJSON ¶
func (hc *HybridCodec) UnmarshalJSON(bz []byte, ptr interface{}) error
type ProtoCodec ¶
type ProtoCodec struct {
// contains filtered or unexported fields
}
ProtoCodec defines a codec that utilizes Protobuf for both binary and JSON encoding.
func (*ProtoCodec) MarshalBinaryBare ¶
func (pc *ProtoCodec) MarshalBinaryBare(o ProtoMarshaler) ([]byte, error)
func (*ProtoCodec) MarshalBinaryLengthPrefixed ¶
func (pc *ProtoCodec) MarshalBinaryLengthPrefixed(o ProtoMarshaler) ([]byte, error)
func (*ProtoCodec) MarshalJSON ¶
func (pc *ProtoCodec) MarshalJSON(o interface{}) ([]byte, error)
func (*ProtoCodec) MustMarshalBinaryBare ¶
func (pc *ProtoCodec) MustMarshalBinaryBare(o ProtoMarshaler) []byte
func (*ProtoCodec) MustMarshalBinaryLengthPrefixed ¶
func (pc *ProtoCodec) MustMarshalBinaryLengthPrefixed(o ProtoMarshaler) []byte
func (*ProtoCodec) MustMarshalJSON ¶
func (pc *ProtoCodec) MustMarshalJSON(o interface{}) []byte
func (*ProtoCodec) MustUnmarshalBinaryBare ¶
func (pc *ProtoCodec) MustUnmarshalBinaryBare(bz []byte, ptr ProtoMarshaler)
func (*ProtoCodec) MustUnmarshalBinaryLengthPrefixed ¶
func (pc *ProtoCodec) MustUnmarshalBinaryLengthPrefixed(bz []byte, ptr ProtoMarshaler)
func (*ProtoCodec) MustUnmarshalJSON ¶
func (pc *ProtoCodec) MustUnmarshalJSON(bz []byte, ptr interface{})
func (*ProtoCodec) UnmarshalBinaryBare ¶
func (pc *ProtoCodec) UnmarshalBinaryBare(bz []byte, ptr ProtoMarshaler) error
func (*ProtoCodec) UnmarshalBinaryLengthPrefixed ¶
func (pc *ProtoCodec) UnmarshalBinaryLengthPrefixed(bz []byte, ptr ProtoMarshaler) error
func (*ProtoCodec) UnmarshalJSON ¶
func (pc *ProtoCodec) UnmarshalJSON(bz []byte, ptr interface{}) error
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package types defines a custom wrapper for google.protobuf.Any which supports cached values as well as InterfaceRegistry which keeps track of types which can be used with Any for both security and introspection
|
Package types defines a custom wrapper for google.protobuf.Any which supports cached values as well as InterfaceRegistry which keeps track of types which can be used with Any for both security and introspection |