codec

package
v0.0.0-...-b02c517 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, b Builder)

Types

type Builder

type Builder interface {
	// Build creates a Codec using a reader and a writer.
	Build(io.Reader, io.Writer) Codec
	// String returns the implementation name.
	String() string
}

type Codec

type Codec interface {
	Encoder
	Decoder
}

func Get

func Get(name string, r io.Reader, w io.Writer) (Codec, error)

type Decoder

type Decoder interface {
	Decode(any) error
}

type Encoder

type Encoder interface {
	Encode(any) error
}

type Gob

type Gob struct{}

func (Gob) Build

func (Gob) Build(r io.Reader, w io.Writer) Codec

func (Gob) String

func (Gob) String() string

type JSON

type JSON struct{}

func (JSON) Build

func (b JSON) Build(r io.Reader, w io.Writer) Codec

func (JSON) String

func (JSON) String() string

Jump to

Keyboard shortcuts

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