encoding

package
v0.0.0-...-a8cc34e Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2020 License: LGPL-3.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Factory

func Factory(name string) *factory.Factory

Factory returns the factory of the name

func Hash

func Hash(v interface{}) hash.Hash256

Hash returns the hash value of v

func Marshal

func Marshal(v interface{}) ([]byte, error)

Marshal returns the encoding of v.

func Register

func Register(value interface{}, enc encoderFunc, dec decoderFunc)

Register registers encoder and decoder functions for a value.

func Unmarshal

func Unmarshal(data []byte, v interface{}) error

Unmarshal decodes the encoded data and stores the result to v

Types

type Decoder

type Decoder struct {
	*msgpack.Decoder
}

Decoder provides decoding functions

func NewDecoder

func NewDecoder(r io.Reader) *Decoder

NewDecoder returns a Encoder

type Encoder

type Encoder struct {
	*msgpack.Encoder
}

Encoder provides encoding functions

func NewEncoder

func NewEncoder(w io.Writer) *Encoder

NewEncoder returns a Encoder

Jump to

Keyboard shortcuts

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