encode

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: 8 Imported by: 0

Documentation

Overview

Package encoder implements BINN encoding.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidValue = errors.New("invalid value")
)

Functions

func Float32 added in v0.1.2

func Float32(f float32) []byte

func Float64 added in v0.1.2

func Float64(f float64) []byte

func Int added in v0.1.2

func Int(v int) []byte

func Int16 added in v0.1.2

func Int16(v int16) []byte

func Int32 added in v0.1.2

func Int32(v int32) []byte

func Int64 added in v0.1.2

func Int64(v int64) []byte

func Int8 added in v0.1.2

func Int8(v int8) []byte

func Marshal

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

func Size added in v0.1.2

func Size(size int, totalSize bool) []byte

func String added in v0.1.2

func String(s string) []byte

func Uint added in v0.1.2

func Uint(v uint) []byte

func Uint16 added in v0.1.2

func Uint16(v uint16) []byte

func Uint32 added in v0.1.2

func Uint32(v uint32) []byte

func Uint64 added in v0.1.2

func Uint64(v uint64) []byte

func Uint8 added in v0.1.2

func Uint8(v uint8) []byte

Types

type Marshaler added in v0.2.0

type Marshaler interface {
	MarshalBINN() ([]byte, error)
}

type MarshalerError added in v0.2.0

type MarshalerError struct {
	Type reflect.Type
	Err  error
	// contains filtered or unexported fields
}

func (*MarshalerError) Error added in v0.2.0

func (e *MarshalerError) Error() string

func (*MarshalerError) Unwrap added in v0.2.0

func (e *MarshalerError) Unwrap() error

type UnsupportedTypeError

type UnsupportedTypeError struct {
	Type reflect.Type
}

func (*UnsupportedTypeError) Error

func (e *UnsupportedTypeError) Error() string

Jump to

Keyboard shortcuts

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