abi

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2022 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DecodeFunc

type DecodeFunc func(dec *Decoder, v interface{}) (done bool, err error)

Fast-path decoding function can be implemented to handle additional types without reflection.

type Decoder

type Decoder struct {
	// contains filtered or unexported fields
}

func NewDecoder

func NewDecoder(r io.Reader, fn DecodeFunc) *Decoder

Create a new EOSIO ABI decoder. Unless you know what you're doing, you should use the chain.NewDecoder() function instead.

func (*Decoder) Decode

func (dec *Decoder) Decode(v interface{}) error

Decode into given value.

func (*Decoder) DecodeValue

func (dec *Decoder) DecodeValue(v reflect.Value) error

Decode into reflected value, you should generally not call this directly.

func (*Decoder) DecodeVariant

func (dec *Decoder) DecodeVariant(v interface{}) error

Decode variant, which must be a struct with all pointer fields.

func (*Decoder) ReadBool

func (dec *Decoder) ReadBool() (bool, error)

func (*Decoder) ReadByte

func (dec *Decoder) ReadByte() (byte, error)

func (*Decoder) ReadBytes

func (dec *Decoder) ReadBytes(n int) (an int, b []byte, err error)

func (*Decoder) ReadFloat32

func (dec *Decoder) ReadFloat32() (float32, error)

func (*Decoder) ReadFloat64

func (dec *Decoder) ReadFloat64() (float64, error)

func (*Decoder) ReadInt16

func (dec *Decoder) ReadInt16() (int16, error)

func (*Decoder) ReadInt32

func (dec *Decoder) ReadInt32() (int32, error)

func (*Decoder) ReadInt64

func (dec *Decoder) ReadInt64() (int64, error)

func (*Decoder) ReadInt8

func (dec *Decoder) ReadInt8() (int8, error)

func (*Decoder) ReadString

func (dec *Decoder) ReadString() (string, error)

func (*Decoder) ReadUint16

func (dec *Decoder) ReadUint16() (uint16, error)

func (*Decoder) ReadUint32

func (dec *Decoder) ReadUint32() (uint32, error)

func (*Decoder) ReadUint64

func (dec *Decoder) ReadUint64() (uint64, error)

func (*Decoder) ReadUint8

func (dec *Decoder) ReadUint8() (uint8, error)

func (*Decoder) ReadVarint

func (dec *Decoder) ReadVarint() (int, error)

func (*Decoder) ReadVaruint

func (dec *Decoder) ReadVaruint() (uint, error)

type EncodeFunc

type EncodeFunc func(enc *Encoder, v interface{}) (done bool, err error)

Fast-path decoding function can be implemented to handle additional types without reflection.

type Encoder

type Encoder struct {
	// contains filtered or unexported fields
}

func NewEncoder

func NewEncoder(w io.Writer, fn EncodeFunc) *Encoder

func (*Encoder) Encode

func (enc *Encoder) Encode(v interface{}) error

Encode given value.

func (*Encoder) EncodeValue

func (enc *Encoder) EncodeValue(v reflect.Value) error

func (*Encoder) WriteBool

func (enc *Encoder) WriteBool(v bool) error

func (*Encoder) WriteByte

func (enc *Encoder) WriteByte(b byte) error

func (*Encoder) WriteBytes

func (enc *Encoder) WriteBytes(b []byte) error

func (*Encoder) WriteFloat32

func (enc *Encoder) WriteFloat32(v float32) error

func (*Encoder) WriteFloat64

func (enc *Encoder) WriteFloat64(v float64) error

func (*Encoder) WriteInt16

func (enc *Encoder) WriteInt16(v int16) error

func (*Encoder) WriteInt32

func (enc *Encoder) WriteInt32(v int32) error

func (*Encoder) WriteInt64

func (enc *Encoder) WriteInt64(v int64) error

func (*Encoder) WriteInt8

func (enc *Encoder) WriteInt8(v int8) error

func (*Encoder) WriteString

func (enc *Encoder) WriteString(v string) error

func (*Encoder) WriteUint16

func (enc *Encoder) WriteUint16(v uint16) error

func (*Encoder) WriteUint32

func (enc *Encoder) WriteUint32(v uint32) error

func (*Encoder) WriteUint64

func (enc *Encoder) WriteUint64(v uint64) error

func (*Encoder) WriteUint8

func (enc *Encoder) WriteUint8(v uint8) error

func (*Encoder) WriteVarint

func (enc *Encoder) WriteVarint(v int) error

func (*Encoder) WriteVaruint

func (enc *Encoder) WriteVaruint(v uint) error

type Marshaler

type Marshaler interface {
	MarshalABI(*Encoder) error
}

type Unmarshaler

type Unmarshaler interface {
	UnmarshalABI(*Decoder) error
}

Jump to

Keyboard shortcuts

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