serde

package
v0.0.0-...-088a001 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2018 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func De

func De(t Serde, data []byte, offset uint32, opts interface{}) error

De deserializes a field.

func Ser

func Ser(t Serde, data []byte, offset uint32, opts interface{}) error

Ser serializes a field.

Types

type Field

type Field struct {
	Offset           uint32
	Length           uint32
	Contents         *[]byte
	SerializerFunc   FieldSerializerFunc
	DeserializerFunc FieldDeserializerFunc
}

Field represents a field in a datastructure.

type FieldDeserializerFunc

type FieldDeserializerFunc = func(uint32, uint32, []byte, interface{}) ([]byte, error)

FieldDeserializerFunc is the func signature for deserialization.

type FieldSerializerFunc

type FieldSerializerFunc = func([]byte, interface{}) error

FieldSerializerFunc is the func signature for serialization.

type Serde

type Serde interface {
	Fields() []*Field
}

Serde describes a serializer/deserializer.

Jump to

Keyboard shortcuts

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