codec

package
v0.5.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 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