binary

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BigEndian

func BigEndian() encodings.Builder

func LittleEndian

func LittleEndian() encodings.Builder

func NewBigInt

func NewBigInt(numBytes uint, signed bool, intEncoder bigIntEncoder) (encodings.TypeCodec, error)

func NewString

func NewString(maxLength uint, encoder encodings.Builder) (encodings.TypeCodec, error)

Types

type Bool

type Bool struct{}

func (Bool) Decode

func (Bool) Decode(encoded []byte) (any, []byte, error)

func (Bool) Encode

func (Bool) Encode(value any, into []byte) ([]byte, error)

func (Bool) FixedSize

func (Bool) FixedSize() (int, error)

func (Bool) GetType

func (Bool) GetType() reflect.Type

func (Bool) Size

func (Bool) Size(numItems int) (int, error)

type Float32

type Float32 Uint32

Float32 follows IEEE-754 convention for float32, the specification says what the "high" and "low" bits represent Leaving endianness to specify the byte ordering.

func (*Float32) Decode

func (f *Float32) Decode(encoded []byte) (any, []byte, error)

func (*Float32) Encode

func (f *Float32) Encode(value any, into []byte) ([]byte, error)

func (*Float32) FixedSize

func (f *Float32) FixedSize() (int, error)

func (*Float32) GetType

func (f *Float32) GetType() reflect.Type

func (*Float32) Size

func (f *Float32) Size(_ int) (int, error)

type Float64

type Float64 Int64

Float64 follows IEEE-754 convention for float64, the specification says what the "high" and "low" bits represent Leaving endianness to specify the byte ordering.

func (*Float64) Decode

func (f *Float64) Decode(encoded []byte) (any, []byte, error)

func (*Float64) Encode

func (f *Float64) Encode(value any, into []byte) ([]byte, error)

func (*Float64) FixedSize

func (f *Float64) FixedSize() (int, error)

func (*Float64) GetType

func (f *Float64) GetType() reflect.Type

func (*Float64) Size

func (f *Float64) Size(_ int) (int, error)

type Int16

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

func (*Int16) Decode

func (i *Int16) Decode(encoded []byte) (any, []byte, error)

func (*Int16) Encode

func (i *Int16) Encode(value any, into []byte) ([]byte, error)

func (*Int16) FixedSize

func (*Int16) FixedSize() (int, error)

func (*Int16) GetType

func (*Int16) GetType() reflect.Type

func (*Int16) Size

func (*Int16) Size(int) (int, error)

type Int32

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

func (*Int32) Decode

func (i *Int32) Decode(encoded []byte) (any, []byte, error)

func (*Int32) Encode

func (i *Int32) Encode(value any, into []byte) ([]byte, error)

func (*Int32) FixedSize

func (*Int32) FixedSize() (int, error)

func (*Int32) GetType

func (*Int32) GetType() reflect.Type

func (*Int32) Size

func (*Int32) Size(int) (int, error)

type Int64

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

func (*Int64) Decode

func (i *Int64) Decode(encoded []byte) (any, []byte, error)

func (*Int64) Encode

func (i *Int64) Encode(value any, into []byte) ([]byte, error)

func (*Int64) FixedSize

func (*Int64) FixedSize() (int, error)

func (*Int64) GetType

func (*Int64) GetType() reflect.Type

func (*Int64) Size

func (*Int64) Size(int) (int, error)

type Int8

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

func (*Int8) Decode

func (i *Int8) Decode(encoded []byte) (any, []byte, error)

func (*Int8) Encode

func (i *Int8) Encode(value any, into []byte) ([]byte, error)

func (*Int8) FixedSize

func (*Int8) FixedSize() (int, error)

func (*Int8) GetType

func (*Int8) GetType() reflect.Type

func (*Int8) Size

func (*Int8) Size(int) (int, error)

type OracleID

type OracleID Uint8

func (*OracleID) Decode

func (o *OracleID) Decode(encoded []byte) (any, []byte, error)

func (*OracleID) Encode

func (o *OracleID) Encode(value any, into []byte) ([]byte, error)

func (*OracleID) FixedSize

func (o *OracleID) FixedSize() (int, error)

func (*OracleID) GetType

func (o *OracleID) GetType() reflect.Type

func (*OracleID) Size

func (o *OracleID) Size(_ int) (int, error)

type Uint16

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

func (*Uint16) Decode

func (i *Uint16) Decode(encoded []byte) (any, []byte, error)

func (*Uint16) Encode

func (i *Uint16) Encode(value any, into []byte) ([]byte, error)

func (*Uint16) FixedSize

func (*Uint16) FixedSize() (int, error)

func (*Uint16) GetType

func (*Uint16) GetType() reflect.Type

func (*Uint16) Size

func (*Uint16) Size(int) (int, error)

type Uint32

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

func (*Uint32) Decode

func (i *Uint32) Decode(encoded []byte) (any, []byte, error)

func (*Uint32) Encode

func (i *Uint32) Encode(value any, into []byte) ([]byte, error)

func (*Uint32) FixedSize

func (*Uint32) FixedSize() (int, error)

func (*Uint32) GetType

func (*Uint32) GetType() reflect.Type

func (*Uint32) Size

func (*Uint32) Size(int) (int, error)

type Uint64

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

func (*Uint64) Decode

func (i *Uint64) Decode(encoded []byte) (any, []byte, error)

func (*Uint64) Encode

func (i *Uint64) Encode(value any, into []byte) ([]byte, error)

func (*Uint64) FixedSize

func (*Uint64) FixedSize() (int, error)

func (*Uint64) GetType

func (*Uint64) GetType() reflect.Type

func (*Uint64) Size

func (*Uint64) Size(int) (int, error)

type Uint8

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

func (*Uint8) Decode

func (i *Uint8) Decode(encoded []byte) (any, []byte, error)

func (*Uint8) Encode

func (i *Uint8) Encode(value any, into []byte) ([]byte, error)

func (*Uint8) FixedSize

func (*Uint8) FixedSize() (int, error)

func (*Uint8) GetType

func (*Uint8) GetType() reflect.Type

func (*Uint8) Size

func (*Uint8) Size(int) (int, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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