codec

package
v0.0.0-...-38146a2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CBORCodec

type CBORCodec struct{}

CBORCodec provides a codec API for a CBOR encoder and decoder.

func (CBORCodec) Decoder

func (c CBORCodec) Decoder(r io.Reader) Decoder

Decoder returns a CBOR decoder

func (CBORCodec) Encoder

func (c CBORCodec) Encoder(w io.Writer) Encoder

Encoder returns a CBOR encoder

type Codec

type Codec interface {
	Encoder(w io.Writer) Encoder
	Decoder(r io.Reader) Decoder
}

Codec returns an Encoder or Decoder given a Writer or Reader.

type Decoder

type Decoder interface {
	// Decode reads the next encoded value from its Reader and stores it in the value pointed to by v.
	Decode(v interface{}) error
}

type Encoder

type Encoder interface {
	// Encode writes an encoding of v to its Writer.
	Encode(v interface{}) error
}

type JSONCodec

type JSONCodec struct{}

JSONCodec provides a codec API for the standard library JSON encoder and decoder.

func (JSONCodec) Decoder

func (c JSONCodec) Decoder(r io.Reader) Decoder

Decoder returns a JSON decoder

func (JSONCodec) Encoder

func (c JSONCodec) Encoder(w io.Writer) Encoder

Encoder returns a JSON encoder

Jump to

Keyboard shortcuts

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