segmentio

package module
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 2 Imported by: 0

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 New

func New() *SegmentioCodec

New returns a new SegmentioCodec.

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.

Jump to

Keyboard shortcuts

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