record

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const HeaderSize = dataFieldSO // 7

Variables

This section is empty.

Functions

This section is empty.

Types

type Record

type Record struct {
	// CRC is crc32c of Type and Data
	CRC uint32
	// Length is len(Data). optimize?
	Length uint16
	Type   Type
	Data   []byte
}

func Pack

func Pack(entry []byte, firstSize, otherSize int) ([]Record, int)

func Unmarshal

func Unmarshal(data []byte) (record Record, err error)

func (*Record) Marshal

func (r *Record) Marshal() []byte

func (*Record) MarshalTo

func (r *Record) MarshalTo(data []byte) (int, error)

func (*Record) Size

func (r *Record) Size() int

type Type

type Type uint8
const (
	Zero Type = iota
	Full
	First
	Middle
	Last
)

func (Type) IsNonTerminal

func (t Type) IsNonTerminal() bool

func (Type) IsTerminal

func (t Type) IsTerminal() bool

Jump to

Keyboard shortcuts

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