decode

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: MIT Imports: 12 Imported by: 2

Documentation

Overview

Package decode implements BINN decoding.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownType        = errors.New("unknown storage type")
	ErrCantSetValue       = errors.New("can't set value")
	ErrItemNotFound       = errors.New("item not found")
	ErrInvalidItem        = errors.New("invalid item")
	ErrInvalidStructValue = errors.New("invalid struct value")
	ErrIncompleteRead     = errors.New("incomplete read")
)

Functions

func Float32 added in v0.1.2

func Float32(b []byte) float32

func Float64 added in v0.1.2

func Float64(b []byte) float64

func Int16 added in v0.1.2

func Int16(b []byte) int16

func Int32 added in v0.1.2

func Int32(b []byte) int32

func Int64 added in v0.1.2

func Int64(b []byte) int64

func Int8 added in v0.1.2

func Int8(b []byte) int8

func String added in v0.1.2

func String(b []byte) string

func Type added in v0.1.2

func Type(b []byte) binn.Type

func Uint16 added in v0.1.2

func Uint16(b []byte) uint16

func Uint32 added in v0.1.2

func Uint32(b []byte) uint32

func Uint64 added in v0.1.2

func Uint64(b []byte) uint64

func Uint8 added in v0.1.2

func Uint8(b []byte) uint8

func Unmarshal

func Unmarshal(data []byte, v interface{}) error

Types

type Decoder added in v0.1.3

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

func NewDecoder added in v0.1.3

func NewDecoder(r io.Reader) *Decoder

func (*Decoder) Decode added in v0.1.3

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

type FailedToReadSizeError added in v0.2.2

type FailedToReadSizeError struct {
	Previous error
}

func (*FailedToReadSizeError) Error added in v0.2.2

func (err *FailedToReadSizeError) Error() string

func (*FailedToReadSizeError) Unwrap added in v0.2.2

func (err *FailedToReadSizeError) Unwrap() error

type FailedToReadTypeError added in v0.2.2

type FailedToReadTypeError struct {
	Previous error
}

func (*FailedToReadTypeError) Error added in v0.2.2

func (err *FailedToReadTypeError) Error() string

func (*FailedToReadTypeError) Unwrap added in v0.2.2

func (err *FailedToReadTypeError) Unwrap() error

type InvalidUnmarshalError

type InvalidUnmarshalError struct {
	Type reflect.Type
}

func (*InvalidUnmarshalError) Error

func (e *InvalidUnmarshalError) Error() string

type UnknownValueError

type UnknownValueError struct {
	Expected reflect.Kind
	Got      reflect.Kind
}

func (*UnknownValueError) Error

func (e *UnknownValueError) Error() string

type Unmarshaler added in v0.2.0

type Unmarshaler interface {
	UnmarshalBINN([]byte) error
}

Jump to

Keyboard shortcuts

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