codec

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package codec provides a model and conventions for marshaling and unmarshaling values to and from their encodings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface added in v0.11.0

type Interface interface {
	MarshalWrite(w io.Writer, in any) error
	UnmarshalRead(r io.Reader, out any) error
}

Interface defines the interface for reading and writing from data

func NewJSONCodec

func NewJSONCodec() Interface

func WithOptions added in v0.14.1

func WithOptions(i Interface, opts ...Option) (Interface, error)

WithOptions applies options to the given codec

type Option added in v0.14.1

type Option interface {
	// contains filtered or unexported methods
}

Option implements options for codecs

func DisallowUnknownFields added in v0.14.1

func DisallowUnknownFields() Option

DisallowUnknownFields affects unmarshaling and prevents unknown fields from being specified.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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