Help us shape the future of Go! Take the 2026 Go Developer Survey

codec

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2019 License: Apache-2.0 Imports: 2 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Codec

type Codec interface {
	Decode([]byte) (interface{}, error)
	Encode(interface{}) ([]byte, error)
}

Codec allows KV clients to serialise and deserialise values.

type Proto

type Proto struct {
	Factory func() proto.Message
}

Proto is a Codec for proto/snappy

func (Proto) Decode

func (p Proto) Decode(bytes []byte) (interface{}, error)

Decode implements Codec

func (Proto) Encode

func (p Proto) Encode(msg interface{}) ([]byte, error)

Encode implements Codec

type String

type String struct{}

String is a code for strings.

func (String) Decode

func (String) Decode(bytes []byte) (interface{}, error)

Decode implements Codec.

func (String) Encode

func (String) Encode(msg interface{}) ([]byte, error)

Encode implements Codec.

Jump to

Keyboard shortcuts

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