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 Codec ¶
type Codec struct {
Interface
}
Codec provides a wrapper around the basic interface to facilitate common codec operations
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
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.
Click to show internal directories.
Click to hide internal directories.