codec

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: 14 Imported by: 0

Documentation

Index

Constants

View Source
const IndexSize = 24

Variables

View Source
var (
	ErrInvalid          = errors.New("vsb.codec: invalid argument")
	ErrBufferNotEnough  = errors.New("vsb.codec: buffer not enough")
	ErrIncompletePacket = errors.New("vsb.codec: incomplete packet")
	ErrCorruptedPacket  = errors.New("vsb.codec: corrupted packet")
	ErrCorruptedRecord  = errors.New("vsb.codec: corrupted record")
	ErrUnknownRecord    = errors.New("vsb.codec: unknown record")
)

Functions

This section is empty.

Types

type EntryDecoder

type EntryDecoder interface {
	Unmarshal(data []byte) (int, block.Entry, error)
	UnmarshalLast(data []byte) (int, block.Entry, error)
	UnmarshalReader(r io.ReadSeeker) (int, block.Entry, error)
}

func NewDecoder

func NewDecoder(checkCRC bool, indexSize int) (EntryDecoder, error)

type EntryEncoder

type EntryEncoder interface {
	Size(entry block.Entry) int
	MarshalTo(entry block.Entry, buf []byte) (int, error)
}

func NewEncoder

func NewEncoder() EntryEncoder

type PacketDataDecoder

type PacketDataDecoder interface {
	Unmarshal(data []byte) (block.Entry, error)
}

type PacketDataEncoder

type PacketDataEncoder interface {
	Size(entry block.Entry) int
	MarshalTo(entry block.Entry, buf []byte) (int, error)
}

type RecordDataDecoder

type RecordDataDecoder interface {
	Unmarshal(t uint16, offset int, data []byte) (block.Entry, error)
}

type RecordDataEncoder

type RecordDataEncoder interface {
	Size(entry block.Entry) int
	MarshalTo(entry block.Entry, buf []byte) (int, int, error)
}

Jump to

Keyboard shortcuts

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