Documentation ¶
Index ¶
- Constants
- Variables
- func Decode(r io.Reader, val interface{}) error
- func DecodeBytes(b []byte, val interface{}) error
- func Encode(w io.Writer, val interface{}) error
- func EncodeSize(val interface{}) (int, error)
- func EncodeToBytes(val interface{}) ([]byte, error)
- type Decoder
- func (d *Decoder) Decode(v interface{}) (err error)
- func (d *Decoder) GetData() []byte
- func (d *Decoder) GetPos() int
- func (d *Decoder) ReadBool() (out bool, err error)
- func (d *Decoder) ReadByte() (out byte, err error)
- func (d *Decoder) ReadByteArray() (out []byte, err error)
- func (d *Decoder) ReadChecksum160() (out []byte, err error)
- func (d *Decoder) ReadChecksum256() (out []byte, err error)
- func (d *Decoder) ReadChecksum512() (out []byte, err error)
- func (d *Decoder) ReadFloat32() (out float32, err error)
- func (d *Decoder) ReadFloat64() (out float64, err error)
- func (d *Decoder) ReadInt16() (out int16, err error)
- func (d *Decoder) ReadInt32() (out int32, err error)
- func (d *Decoder) ReadInt64() (out int64, err error)
- func (d *Decoder) ReadInt8() (out int8, err error)
- func (d *Decoder) ReadName() (out uint64, err error)
- func (d *Decoder) ReadString() (out string, err error)
- func (d *Decoder) ReadUint() (out uint, err error)
- func (d *Decoder) ReadUint128(typeName string) (out []byte, err error)
- func (d *Decoder) ReadUint16() (out uint16, err error)
- func (d *Decoder) ReadUint32() (out uint32, err error)
- func (d *Decoder) ReadUint64() (out uint64, err error)
- func (d *Decoder) ReadUint8() (out byte, err error)
- func (d *Decoder) ReadUvarint32() (out uint32, err error)
- func (d *Decoder) ReadUvarint64() (uint64, error)
- func (d *Decoder) ReadVarint32() (out int32, err error)
- func (d *Decoder) ReadVarint64() (out int64, err error)
- type Encoder
- type Pack
- type Unpack
Constants ¶
View Source
const ( MAX_NUM_ARRAY_ELEMENT = int(1024 * 1024) MAX_SIZE_OF_BYTE_ARRAYS = int(20 * 1024 * 1024) )
Variables ¶
View Source
var ( EOL = errors.New("rlp: end of list") ErrUnPointer = errors.New("rlp: interface given to Decode must be a pointer") ErrElemTooLarge = errors.New("rlp: element is larger than containing list") ErrValueTooLarge = errors.New("rlp: value size exceeds available input length") ErrVarIntBufferSize = errors.New("rlp: invalid buffer size") )
View Source
var TypeSize = struct { Bool int Byte int UInt8 int Int8 int UInt16 int Int16 int UInt32 int Int32 int UInt int Int int UInt64 int Int64 int UInt128 int Float32 int Float64 int Checksum160 int Checksum256 int Checksum512 int PublicKey int Signature int Tstamp int BlockTimestamp int CurrencyName int }{ Bool: 1, Byte: 1, UInt8: 1, Int8: 1, UInt16: 2, Int16: 2, UInt32: 4, Int32: 4, UInt: 4, Int: 4, UInt64: 8, Int64: 8, UInt128: 16, Float32: 4, Float64: 8, Checksum160: 20, Checksum256: 32, Checksum512: 64, PublicKey: 34, Signature: 66, Tstamp: 8, BlockTimestamp: 4, CurrencyName: 7, }
Functions ¶
func DecodeBytes ¶
func EncodeSize ¶
func EncodeToBytes ¶
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder implements the EOS unpacking, similar to FC_BUFFER
func NewDecoder ¶
func (*Decoder) ReadByteArray ¶
func (*Decoder) ReadChecksum160 ¶
func (*Decoder) ReadChecksum256 ¶
func (*Decoder) ReadChecksum512 ¶
func (*Decoder) ReadFloat32 ¶
func (*Decoder) ReadFloat64 ¶
func (*Decoder) ReadString ¶
func (*Decoder) ReadUint128 ¶
func (*Decoder) ReadUint16 ¶
func (*Decoder) ReadUint32 ¶
func (*Decoder) ReadUint64 ¶
func (*Decoder) ReadUvarint32 ¶
func (*Decoder) ReadUvarint64 ¶
func (*Decoder) ReadVarint32 ¶
func (*Decoder) ReadVarint64 ¶
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
-------------------------------------------------------------- Encoder implements the EOS packing, similar to FC_BUFFER --------------------------------------------------------------
func NewEncoder ¶
func (*Encoder) WriteUVarInt ¶
func (*Encoder) WriteVarInt ¶
Click to show internal directories.
Click to hide internal directories.