coding

package
v0.16.3 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownToken = errors.New("coding token is not recognized")
)

Functions

This section is empty.

Types

type Coding

type Coding interface {
	Token() string
	Encode(input []byte) (output []byte, err error)
	Decode(input []byte) (output []byte, err error)
}

type Constructor

type Constructor func(buff []byte) Coding

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(buffSize int64) Manager

func (Manager) AddCoding

func (m Manager) AddCoding(constructor Constructor)

AddCoding adds a coding to the list of available

func (Manager) Decode

func (m Manager) Decode(token Token, input []byte) (output []byte, err error)

func (Manager) Encode

func (m Manager) Encode(token Token, input []byte) (output []byte, err error)

type Token

type Token = string

Jump to

Keyboard shortcuts

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