Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONInterface

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

JSONInterface represents an interface to handle json data

var (
	// DefaultJSONHandler default json handler
	DefaultJSONHandler JSONInterface = 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