dsd

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2019 License: GPL-3.0 Imports: 4 Imported by: 12

Documentation

Index

Constants

View Source
const (
	AUTO    = 0
	STRING  = 83 // S
	BYTES   = 88 // X
	JSON    = 74 // J
	BSON    = 66 // B
	GenCode = 71 // G
)

define types

Variables

This section is empty.

Functions

func Dump

func Dump(t interface{}, format uint8) ([]byte, error)

Dump stores the interface as a dsd formatted data structure.

func Load

func Load(data []byte, t interface{}) (interface{}, error)

Load loads an dsd structured data blob into the given interface.

func LoadAsFormat

func LoadAsFormat(data []byte, format uint8, t interface{}) (interface{}, error)

LoadAsFormat loads a data blob into the interface using the specified format.

Types

type GenCodeCompatible added in v0.3.0

type GenCodeCompatible interface {
	// GenCodeMarshal gencode marshalls the struct into the given byte array, or a new one if its too small.
	GenCodeMarshal(buf []byte) ([]byte, error)
	// GenCodeUnmarshal gencode unmarshalls the struct and returns the bytes read.
	GenCodeUnmarshal(buf []byte) (uint64, error)
}

GenCodeCompatible is an interface to identify and use gencode compatible structs.

Jump to

Keyboard shortcuts

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