serializer

package
v0.1.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2018 License: Apache-2.0 Imports: 2 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(d Decoder, data []byte, obj interface{}) error

Decode is a convenience wrapper for decoding data into an Object.

func Encode

func Encode(e Encoder, obj interface{}) ([]byte, error)

Encode is a convenience wrapper for encoding to a []byte from an Encoder

Types

type Codec

type Codec Serializer

func NewSerializer

func NewSerializer(e Encoder, d Decoder) Codec

NewSerializer creates a NewSerializer from an Encoder and Decoder.

type Decoder

type Decoder interface {
	Decode(data []byte, obj interface{}) error
}

type Encoder

type Encoder interface {
	Encode(obj interface{}, w io.Writer) error
}

type Serializer

type Serializer interface {
	Encoder
	Decoder
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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