record

package
v0.0.0-...-abd5428 Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrRecordTooShort is returned when trying to unmarshal a record that is too
	// short to be valid
	ErrRecordTooShort = errors.New("record is too short")

	// ErrUnknownSchema is returned when trying to unmarshal a record with an
	// unknown schema
	ErrUnknownSchema = errors.New("unknown schema")
)

Functions

func Unmarshal

func Unmarshal(b Record) ([]byte, error)

Unmarshal parsers a Record, validates it against its schema, and returns its payload

Types

type Record

type Record []byte

Record is a slice of bytes representing a schema ID followed by a payload

func Marshal

func Marshal(b []byte) Record

Marshal creates a new Record with the default schema

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳