lencode

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

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

func NewDecoder

func NewDecoder(r io.Reader, opts ...Option) *Decoder

func (*Decoder) Decode

func (d *Decoder) Decode() ([]byte, error)

Decode the next message from the io.Reader.

func (*Decoder) DecodeInto

func (d *Decoder) DecodeInto(b []byte) error

Decode the next message into a provided byte slice. Use NextLen() to ensure the slice is large enough for the message.

func (*Decoder) NextLen

func (d *Decoder) NextLen() (int, error)

Return the length of the next message

type Encoder

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

func NewEncoder

func NewEncoder(w io.Writer, opts ...Option) *Encoder

func (*Encoder) Encode

func (e *Encoder) Encode(msg []byte) error

Encode a message to the underlying writer. It is not safe to call this method concurrently.

type Option

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

func SeparatorOpt

func SeparatorOpt(s []byte) Option

Specify a record separator to use as an integrity check when decoding. This defaults to \x6c\x65\x6e\x63 ("lenc"). Set to nil to disable.

Jump to

Keyboard shortcuts

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