Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Array ¶
type Array []interface{}
func (Array) Finalize ¶
func (a Array) Finalize( path []string, key string, node Unmarshaller, ) error
func (Array) Unmarshal ¶
func (a Array) Unmarshal( path []string, key string, elemType ElementType, value interface{}, ) ( Unmarshaller, Unmarshaller, error, )
type ElementType ¶
type ElementType int
const ( EtUnknown ElementType = iota EtObject EtArray EtKey EtValue EtArrayValue )
type JSONStreamParser ¶
type JSONStreamParser struct {
// contains filtered or unexported fields
}
func NewJSONStreamParser ¶
func NewJSONStreamParser(u Unmarshaller) *JSONStreamParser
func (*JSONStreamParser) Parse ¶
func (p *JSONStreamParser) Parse(input io.Reader) (Unmarshaller, error)
type Map ¶
type Map map[string]interface{}
func (Map) Unmarshal ¶
func (m Map) Unmarshal( path []string, key string, elemType ElementType, value interface{}, ) ( Unmarshaller, Unmarshaller, error, )
type Unmarshaller ¶
type Unmarshaller interface { // unmarshall callback function to handle parsed elements. // // in: path - the absolute parent path of the child element being handled // in: key - the key of the stream element being handled // in: elemType - the type of the stream element. this can be one of Object, Array // or Value. if it is an Object or Array then the returned // Unmarshaller can be specific for that instance // in: value - the value to be handled. if the key type is an Object // or Array this will be nil // // out: Unmarshaller - the unmarshaller for current node // out: Unmarshaller - the unmarshaller for the next node // out: error - if an error occurs while handling the data Unmarshal( path []string, key string, elemType ElementType, value interface{}, ) (Unmarshaller, Unmarshaller, error) // finalizes the a stream object or array once it has been completely parsed // // in: path - the absolute parent path of the child element being handled // in: key - the key of the stream element being handled // in: node - the node to be finalized // // out: error - if an error occurs while handling the data Finalize( path []string, key string, node Unmarshaller, ) error }
Click to show internal directories.
Click to hide internal directories.