codec

package
v0.0.0-...-4e386bd Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Default is the default JSON codec.
	Default = &JSONCodec{
		JSONEncoder: DefaultEncoder,
		JSONDecoder: DefaultDecoder,
	}
)
View Source
var (
	// DefaultDecoder is the default decoder.
	DefaultDecoder = &JSONDecoder{}
)
View Source
var (
	// DefaultEncoder is the default encoder.
	DefaultEncoder = &JSONEncoder{}
)

Functions

This section is empty.

Types

type JSONCodec

type JSONCodec struct {
	*JSONEncoder
	*JSONDecoder
}

JSONCodec is a JSON codec.

type JSONDecoder

type JSONDecoder struct {
}

JSONDecoder decodes JSON.

func (JSONDecoder) Decode

func (d JSONDecoder) Decode(data []byte, v interface{}) error

Decode decodes JSON.

type JSONEncoder

type JSONEncoder struct{}

JSONEncoder encodes a value to JSON.

func (JSONEncoder) Encode

func (e JSONEncoder) Encode(v interface{}) ([]byte, error)

Encode encodes a value to indented. JSON.

Jump to

Keyboard shortcuts

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