codec

package
v0.0.1-20260109-001753... Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Text-based formats
	JSON types.CodecType = "json"
	XML  types.CodecType = "xml"
	YAML types.CodecType = "yaml"
	TOML types.CodecType = "toml"
	INI  types.CodecType = "ini"

	// Binary formats
	Gob         types.CodecType = "gob"
	ProtoBuf    types.CodecType = "protobuf"
	MessagePack types.CodecType = "msgpack"
	CBOR        types.CodecType = "cbor"
	Avro        types.CodecType = "avro"

	// Encoding schemes
	Base64 types.CodecType = "base64"
	Base32 types.CodecType = "base32"
	Base16 types.CodecType = "base16"
	Hex    types.CodecType = "hex"
	URL    types.CodecType = "url"

	// Compression formats
	Gzip   types.CodecType = "gzip"
	Zlib   types.CodecType = "zlib"
	Brotli types.CodecType = "brotli"
	LZ4    types.CodecType = "lz4"
	Snappy types.CodecType = "snappy"
)

for encoding and decoding

Variables

This section is empty.

Functions

func Decode

func Decode[T any](data []byte, codecType types.CodecType) (T, error)

Decode deserializes data based on the codec type.

func Encode

func Encode[T any](data T, codecType types.CodecType) ([]byte, error)

Encode serializes data based on the codec type.

Types

This section is empty.

Jump to

Keyboard shortcuts

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