Documentation ¶
Overview ¶
Package codec provides the interface definitions for encoding types into their byte slice representation, and decoding a byte slice into types.
Package json provides a JSON codec with an encoder/decoder.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder interface { // Decode decodes a byte slice representation into its Go type. Decode(in []byte, out any) error }
Decoder decodes a byte slice representation into its Go type.
func RecordDecodedBytes ¶
func RecordDecodedBytes(d Decoder, m metric.Int64Counter) Decoder
RecordDecodedBytes decorates a decoder with a metric that records the bytes that have been decoded.
type Encoder ¶
type Encoder interface { // Encode encodes a type into its byte slice representation. Encode(in any) ([]byte, error) }
Encoder encodes a type into its byte slice representation.
func RecordEncodedBytes ¶
func RecordEncodedBytes(e Encoder, m metric.Int64Counter) Encoder
RecordEncodedBytes decorates an encoder with a metric that records the bytes that have been encoded.
type JSON ¶
type JSON struct{}
JSON wraps the standard json library.
Click to show internal directories.
Click to hide internal directories.