codec

package
v0.0.0-...-1c52b4b Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCodecNotRegistered = errors.New("rita: codec not registered")

	Default = JSON

	Codecs = map[string]Codec{
		Binary.Name():   Binary,
		JSON.Name():     JSON,
		MsgPack.Name():  MsgPack,
		ProtoBuf.Name(): ProtoBuf,
	}
)

Functions

This section is empty.

Types

type Codec

type Codec interface {
	Name() string
	Marshal(interface{}) ([]byte, error)
	Unmarshal([]byte, interface{}) error
}
var (
	Binary Codec = &binaryCodec{}
)
var (
	JSON Codec = &jsonCodec{}
)
var (
	MsgPack Codec = &msgpackCodec{}
)
var (
	ProtoBuf Codec = &protoBufCodec{}
)

Jump to

Keyboard shortcuts

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