Documentation
¶
Overview ¶
Package segmentio implements the aarv.Codec interface using the github.com/segmentio/encoding/json library, a high-performance drop-in replacement for encoding/json.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SegmentioCodec ¶
type SegmentioCodec struct{}
SegmentioCodec implements aarv.Codec using segmentio/encoding/json.
func (*SegmentioCodec) ContentType ¶
func (c *SegmentioCodec) ContentType() string
ContentType returns the MIME type for JSON content.
func (*SegmentioCodec) Decode ¶
func (c *SegmentioCodec) Decode(r io.Reader, v any) error
Decode reads JSON from r and unmarshals it into v.
func (*SegmentioCodec) Encode ¶
func (c *SegmentioCodec) Encode(w io.Writer, v any) error
Encode marshals v as JSON and writes it to w.
func (*SegmentioCodec) MarshalBytes ¶
func (c *SegmentioCodec) MarshalBytes(v any) ([]byte, error)
MarshalBytes marshals v into JSON bytes.
func (*SegmentioCodec) UnmarshalBytes ¶
func (c *SegmentioCodec) UnmarshalBytes(data []byte, v any) error
UnmarshalBytes unmarshals JSON bytes into v.
Click to show internal directories.
Click to hide internal directories.