encoding

package
v0.0.0-...-3f4335e Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2025 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 interface {
	Decode(r io.Reader, dst interface{}, numValues int) error
}

Decoder is the interface for decoding a slice of values from a reader.

type Encoder

type Encoder interface {
	Encode(w io.Writer, src interface{}) error
}

Encoder is the interface for encoding a slice of values into a writer.

type Fixed

type Fixed struct{}

Fixed is an encoder/decoder for fixed-width data types. It uses binary.Write and binary.Read for efficient serialization.

func NewFixed

func NewFixed() *Fixed

NewFixed creates a new Fixed encoder/decoder.

func (*Fixed) Decode

func (e *Fixed) Decode(r io.Reader, dst interface{}, numValues int) error

Decode reads a slice of fixed-width values from the reader.

func (*Fixed) Encode

func (e *Fixed) Encode(w io.Writer, src interface{}) error

Encode writes a slice of fixed-width values to the writer.

type String

type String struct{}

String is an encoder/decoder for string data. It stores offsets first, then the concatenated string data.

func NewString

func NewString() *String

NewString creates a new String encoder/decoder.

func (*String) Decode

func (e *String) Decode(r io.Reader, dst interface{}, numValues int) error

Decode reads a slice of strings from the reader.

func (*String) Encode

func (e *String) Encode(w io.Writer, src interface{}) error

Encode writes a slice of strings to the writer.

Jump to

Keyboard shortcuts

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