codec

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 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