context

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context[P types.ParameterView] struct {
	Reader        *reader.Reader
	Assembler     *assembler.Assembler
	Hooks         *hooks.Hooks[P]
	Decoders      Decoders[P]
	PoolParameter *Pool[P]
	PoolCommand   *Pool[types.Command[P]]
	Config        types.Config
}

Context is the main context for the parser. It contains the reader, assembler, hooks, decoders, and pools for the parser. It live as long as the parser is used.

func NewContext

func NewContext[P types.ParameterView](reader *reader.Reader, assembler *assembler.Assembler, hooks *hooks.Hooks[P], decoders Decoders[P], config types.Config) *Context[P]

type Decoders

type Decoders[P types.ParameterView] struct {
	ParameterParser              ParameterParser[P]
	ReliableHeaderParameterCount ReliableHeaderParameterCount
}

type ParameterParser

type ParameterParser[P types.ParameterView] interface {
	ParseInto(*reader.Reader, *hooks.Hooks[P], *P) error
}

ParameterParser is implemented by each protocol-version parameters package (v16, v18). It is wired once at Parser construction so the hot path

type Pool added in v1.0.0

type Pool[P any] struct {
	// contains filtered or unexported fields
}

func NewPool added in v1.0.0

func NewPool[P any](maxCap int) *Pool[P]

func (*Pool[P]) Get added in v1.0.0

func (p *Pool[P]) Get(n int) *PooledSlice[P]

func (*Pool[P]) Put added in v1.0.0

func (p *Pool[P]) Put(wrapper *PooledSlice[P])

type PooledSlice added in v1.0.0

type PooledSlice[P any] struct {
	Items []P
}

type ReliableHeaderParameterCount

type ReliableHeaderParameterCount interface {
	Count(*reader.Reader) (int, error)
}

ReliableHeaderParameterCount is implemented by each protocol-version reliable header parameter count package (v16, v18). It is used to count the number of parameters in a reliable header.

Jump to

Keyboard shortcuts

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