ssob

package module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: GPL-2.0 Imports: 9 Imported by: 0

README

ssob

Stupid simple object binary gob like serializer intended to be easy to port and fast

Documentation

Index

Constants

View Source
const (
	ST_COMMON = 0
	ST_SLICE  = 1
	ST_ARRAY  = 2
	ST_STRUCT = 3
	ST_MAP    = 4
)
View Source
const (
	ST_INVALID   = 0
	ST_BOOL      = 1
	ST_UINT8     = 2
	ST_UINT16    = 3
	ST_UINT32    = 4
	ST_UINT64    = 5
	ST_INT8      = 6
	ST_INT16     = 7
	ST_INT32     = 8
	ST_INT64     = 9
	ST_FLOAT32   = 10
	ST_FLOAT64   = 11
	ST_STRING    = 12
	ST_ERROR     = 13
	ST_NIL       = 14
	ST_INTERFACE = 15
)
View Source
const (
	ST_ID_SIZE = 4
)

Variables

View Source
var ErrParseFailed = errors.New("parsing failed")
View Source
var ErrTypeInvalid = errors.New("type invalid")
View Source
var ErrTypeMismatch = errors.New("type mismatch")
View Source
var ErrTypeUnknown = errors.New("type unknown")
View Source
var ErrValueInvalid = errors.New("value invalid")

Functions

func RegisterType added in v1.1.0

func RegisterType(e interface{}) (err error)

Types

type Decoder

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

func NewDecoder

func NewDecoder(r io.Reader) *Decoder

func (*Decoder) Decode

func (dec *Decoder) Decode(e interface{}) (ret interface{}, err error)

type Encoder

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

func NewEncoder

func NewEncoder(w io.Writer) *Encoder

func (*Encoder) Encode

func (enc *Encoder) Encode(e interface{}) (err error)

type NType added in v1.1.0

type NType struct {
	Name        string
	Id          uint32
	Indirection int
	MainTypeId  uint32
	ValType     uint32
	// contains filtered or unexported fields
}

type RegisteredTypes added in v1.1.0

type RegisteredTypes struct {
	NextId uint32
	// contains filtered or unexported fields
}

type StructField added in v1.1.0

type StructField struct {
	Id   uint32
	Name string
	Tag  string
	SId  int
}

type Type added in v1.1.0

type Type struct {
	Name string
	Id   uint32
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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