Documentation ¶
Index ¶
- func Marshal(value interface{}) ([]byte, error)
- func MustMarshal(value interface{}) []byte
- func MustUnmarshal(src []byte, dest interface{})
- func Unmarshal(src []byte, dest interface{}) error
- type Decoder
- func (dec *Decoder) Decode(v interface{}) (int, error)
- func (dec *Decoder) DecodeArray(v reflect.Value) (int, error)
- func (dec *Decoder) DecodeBigNumber(v reflect.Value, expectedLength int) (int, error)
- func (dec *Decoder) DecodeBool() (bool, int, error)
- func (dec *Decoder) DecodeByte() (byte, int, error)
- func (dec *Decoder) DecodeFixedArray(v reflect.Value) (int, error)
- func (dec *Decoder) DecodeFixedByteArray(length int) ([]byte, int, error)
- func (dec *Decoder) DecodeInt32() (int32, int, error)
- func (dec *Decoder) DecodeInt64() (int64, int, error)
- func (dec *Decoder) DecodeMap(v reflect.Value) (int, error)
- func (dec *Decoder) DecodeOptional(v reflect.Value) (int, error)
- func (dec *Decoder) DecodeResult(v reflect.Value) (int, error)
- func (dec *Decoder) DecodeString() (string, int, error)
- func (dec *Decoder) DecodeStruct(v reflect.Value) (int, error)
- func (dec *Decoder) DecodeTuple(v reflect.Value) (int, error)
- func (dec *Decoder) DecodeU128(v reflect.Value) (int, error)
- func (dec *Decoder) DecodeU256(v reflect.Value) (int, error)
- func (dec *Decoder) DecodeU512(v reflect.Value) (int, error)
- func (dec *Decoder) DecodeUInt32() (uint32, int, error)
- func (dec *Decoder) DecodeUInt64() (uint64, int, error)
- func (dec *Decoder) DecodeUnion(v reflect.Value, discriminant byte) (int, error)
- func (dec *Decoder) DecodeUnmarshaler(v reflect.Value) (int, error)
- type Encoder
- func (enc *Encoder) Encode(v interface{}) (int, error)
- func (enc *Encoder) EncodeArray(v reflect.Value) (int, error)
- func (enc *Encoder) EncodeBigInt(v big.Int) (int, error)
- func (enc *Encoder) EncodeBool(v bool) (int, error)
- func (enc *Encoder) EncodeByte(v byte) (int, error)
- func (enc *Encoder) EncodeByteArray(v []byte) (int, error)
- func (enc *Encoder) EncodeFixedArray(v reflect.Value) (int, error)
- func (enc *Encoder) EncodeFixedByteArray(v []byte) (int, error)
- func (enc *Encoder) EncodeInt32(v int32) (int, error)
- func (enc *Encoder) EncodeInt64(v int64) (int, error)
- func (enc *Encoder) EncodeInterface(v reflect.Value) (int, error)
- func (enc *Encoder) EncodeMap(v reflect.Value) (int, error)
- func (enc *Encoder) EncodeMarshaler(v reflect.Value) (int, error)
- func (enc *Encoder) EncodeOptional(v reflect.Value) (int, error)
- func (enc *Encoder) EncodeResult(v reflect.Value) (int, error)
- func (enc *Encoder) EncodeString(v string) (int, error)
- func (enc *Encoder) EncodeStruct(v reflect.Value) (int, error)
- func (enc *Encoder) EncodeTuple(v reflect.Value) (int, error)
- func (enc *Encoder) EncodeUInt32(v uint32) (int, error)
- func (enc *Encoder) EncodeUInt64(v uint64) (int, error)
- func (enc *Encoder) EncodeUnion(v reflect.Value) (int, error)
- type Marshaler
- type Result
- type Tuple
- type U128
- type U256
- type U512
- type Union
- type Unmarshaler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustMarshal ¶
func MustMarshal(value interface{}) []byte
MustMarshal is the panic-on-fail version of Marshal
func MustUnmarshal ¶
func MustUnmarshal(src []byte, dest interface{})
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
func NewDecoder ¶
func (*Decoder) DecodeArray ¶
DecodeArray decodes array
func (*Decoder) DecodeBigNumber ¶
func (*Decoder) DecodeBool ¶
DecodeBool decodes bool. Returns the number of bytes read
func (*Decoder) DecodeByte ¶
DecodeByte decodes byte
func (*Decoder) DecodeFixedArray ¶
DecodeFixedArray decodes array for which the size is determined when the array is created
func (*Decoder) DecodeFixedByteArray ¶
func (*Decoder) DecodeInt32 ¶
DecodeInt32 decodes int32
func (*Decoder) DecodeInt64 ¶
DecodeInt64 decodes int64
func (*Decoder) DecodeString ¶
DecodeString decodes string
func (*Decoder) DecodeStruct ¶
DecodeStruct decodes struct
func (*Decoder) DecodeTuple ¶
DecodeTuple decodes tuple
func (*Decoder) DecodeU128 ¶
DecodeU128 decodes uint128
func (*Decoder) DecodeU256 ¶
DecodeU256 decodes uint256
func (*Decoder) DecodeU512 ¶
DecodeU512 decodes decodes uint512
func (*Decoder) DecodeUInt32 ¶
DecodeUInt32 decodes uint32
func (*Decoder) DecodeUInt64 ¶
DecodeUInt64 decodes uint64
func (*Decoder) DecodeUnion ¶
DecodeUnion decodes union
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
func NewEncoder ¶
func (*Encoder) EncodeArray ¶
EncodeArray encodes array
func (*Encoder) EncodeBigInt ¶
EncodeBigInt encodes big number
func (*Encoder) EncodeBool ¶
EncodeBool encodes bool value
func (*Encoder) EncodeByte ¶
EncodeByte encodes byte value
func (*Encoder) EncodeByteArray ¶
EncodeByteArray encodes byte array
func (*Encoder) EncodeFixedArray ¶
EncodeFixedArray encodes array with fixed size
func (*Encoder) EncodeFixedByteArray ¶
EncodeFixedByteArray encodes byte array with fixed size
func (*Encoder) EncodeInt32 ¶
EncodeInt32 encodes int32 value
func (*Encoder) EncodeInt64 ¶
EncodeInt64 encodes int64 value
func (*Encoder) EncodeInterface ¶
EncodeInterface encodes interface
func (*Encoder) EncodeString ¶
EncodeString encodes string value
func (*Encoder) EncodeStruct ¶
EncodeStruct encodes struct
func (*Encoder) EncodeTuple ¶
EncodeTuple encodes tuple
func (*Encoder) EncodeUInt32 ¶
EncodeUIn32 encodes uint32 value
func (*Encoder) EncodeUInt64 ¶
EncodeUIn64 encodes uint64 value