serde

package
v0.1.1-0...-42241d0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package serde provides functions for serializing and deserializing binary data.

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([]byte, interface{}) error

FieldDeserializerFunc is the func signature for serialization.

type FieldSerializerFunc

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

FieldSerializerFunc is the func signature for deserialization.

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