magic

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: Unlicense Imports: 1 Imported by: 0

Documentation

Overview

Package magic is a simple specification and error helper for message identifying 4 byte strings that are used for the switching logic of a relay.

Index

Constants

View Source
const (
	// Len is the length in bytes of the magic bytes that prefixes all Indra
	// messages.
	Len = 4

	// ErrTooShort is an error for codec.Codec implementations to signal a message
	// buffer is shorter than the minimum defined for the message type.
	ErrTooShort = "'%s' message  minimum size: %d got: %d"
)

Variables

This section is empty.

Functions

func TooShort

func TooShort(got, found int, magic string) (e error)

TooShort is a helper function to return an error for a truncated packet.

Types

This section is empty.

Jump to

Keyboard shortcuts

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