internal

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2025 License: BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Overview

Package internal contains code that is shared among encoding implementations.

Index

Constants

This section is empty.

Variables

View Source
var ErrASCIIReplacement = RepertoireError(encoding.ASCIISub)

Functions

This section is empty.

Types

type Encoding

type Encoding struct {
	encoding.Encoding
	Name string
	MIB  identifier.MIB
}

Encoding is an implementation of the Encoding interface that adds the String and ID methods to an existing encoding.

func (*Encoding) ID

func (e *Encoding) ID() (mib identifier.MIB, other string)

func (*Encoding) String

func (e *Encoding) String() string

type FuncEncoding

type FuncEncoding struct {
	Decoder func() transform.Transformer
	Encoder func() transform.Transformer
}

FuncEncoding is an Encoding that combines two functions returning a new Transformer.

func (FuncEncoding) NewDecoder

func (e FuncEncoding) NewDecoder() *encoding.Decoder

func (FuncEncoding) NewEncoder

func (e FuncEncoding) NewEncoder() *encoding.Encoder

type RepertoireError

type RepertoireError byte

A RepertoireError indicates a rune is not in the repertoire of a destination encoding. It is associated with an encoding-specific suggested replacement byte.

func (RepertoireError) Error

func (r RepertoireError) Error() string

Error implements the error interface.

func (RepertoireError) Replacement

func (r RepertoireError) Replacement() byte

Replacement returns the replacement string associated with this error.

type SimpleEncoding

type SimpleEncoding struct {
	Decoder transform.Transformer
	Encoder transform.Transformer
}

SimpleEncoding is an Encoding that combines two Transformers.

func (*SimpleEncoding) NewDecoder

func (e *SimpleEncoding) NewDecoder() *encoding.Decoder

func (*SimpleEncoding) NewEncoder

func (e *SimpleEncoding) NewEncoder() *encoding.Encoder

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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