Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	Marshal(v interface{}) ([]byte, error)
	Unmarshal(data []byte, v interface{}) error
}

Interface represents an interface to handle json data

var (
	// DefaultJSONHandler default json handler
	DefaultJSONHandler Interface = StdJSON{}
)

type StdJSON

type StdJSON struct{}

StdJSON implements JSONInterface via encoding/json

func (StdJSON) Marshal

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

Marshal implements JSONInterface

func (StdJSON) Unmarshal

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

Unmarshal implements JSONInterface

Source Files