codec

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize(c *Codec)

Types

type Binary added in v0.4.0

type Binary struct {
	EncodeContentType string
}

func (Binary) ContentType added in v0.4.0

func (c Binary) ContentType() string

func (Binary) Decode added in v0.4.0

func (c Binary) Decode(src io.Reader, dst any) error

func (Binary) Encode added in v0.4.0

func (c Binary) Encode(src any, dst io.Writer) error

type Codec

type Codec struct {
	Input  Decoder
	Output Encoder
}

type Decoder

type Decoder interface {
	Decode(src io.Reader, dst any) error
}

type Encoder

type Encoder interface {
	ContentType() string
	Encode(src any, dst io.Writer) error
}

type JSON

type JSON struct{}

func (JSON) ContentType added in v0.4.0

func (c JSON) ContentType() string

func (JSON) Decode

func (c JSON) Decode(src io.Reader, dst any) error

func (JSON) Encode

func (c JSON) Encode(src any, dst io.Writer) error

type Noop added in v0.4.0

type Noop struct{}

func (Noop) ContentType added in v0.4.0

func (c Noop) ContentType() string

func (Noop) Decode added in v0.4.0

func (c Noop) Decode(_ io.Reader, _ any) error

func (Noop) Encode added in v0.4.0

func (c Noop) Encode(src any, dst io.Writer) error

type XML

type XML struct{}

func (XML) ContentType added in v0.4.0

func (c XML) ContentType() string

func (XML) Decode

func (c XML) Decode(src io.Reader, dst any) error

func (XML) Encode

func (c XML) Encode(src any, dst io.Writer) error

Jump to

Keyboard shortcuts

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