Help us shape the future of Go! Take the 2026 Go Developer Survey

codec

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Codec

type Codec interface {
	Name() string
	ContentType() string
	Marshal(v any) ([]byte, error)
	Unmarshal(data []byte, v any) error
	NewDecoder(r io.Reader) Decoder
	NewEncoder(w io.Writer) Encoder
}

Codec defines serialization and deserialization across all Nexss transports.

var Default Codec = JSON{}

Default is the fallback JSON codec used across all transports.

type Decoder

type Decoder interface {
	Decode(v any) error
}

type Encoder

type Encoder interface {
	Encode(v any) error
}

type JSON

type JSON struct{}

JSON is the default standard library JSON codec.

func (JSON) ContentType

func (JSON) ContentType() string

func (JSON) Marshal

func (JSON) Marshal(v any) ([]byte, error)

func (JSON) Name

func (JSON) Name() string

func (JSON) NewDecoder

func (JSON) NewDecoder(r io.Reader) Decoder

func (JSON) NewEncoder

func (JSON) NewEncoder(w io.Writer) Encoder

func (JSON) Unmarshal

func (JSON) Unmarshal(data []byte, v any) error

Jump to

Keyboard shortcuts

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