coding

package
v0.10.5 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2023 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 Encoding added in v0.10.5

type Encoding struct {
	// Transfer stores Transfer-Encoding tokens
	Transfer []string
	// Content stores Content-Encoding tokens
	Content []string
	// HasTrailer defines, whether there are additional headers can be stored in
	// a zero-length chunk (if Transfer-Encoding is chunked)
	HasTrailer bool
}

func (Encoding) Identity added in v0.10.5

func (e Encoding) Identity() bool

Identity returns, whether the message was encoded

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