Documentation
¶
Index ¶
- Constants
- Variables
- func Any(in []byte, pos int) (int, error)
- func Array(in []byte, pos int) (int, error)
- func AsArray(in []byte, pos int) ([][]byte, error)
- func Boolean(in []byte, pos int) (int, error)
- func Expect(in []byte, pos int, content ...byte) (int, error)
- func FindIndex(in []byte, pos, index int) ([]byte, error)
- func FindKey(in []byte, pos int, k []byte) ([]byte, error)
- func FindKey2(in []byte, k []byte) ([]byte, error)
- func FindRange(in []byte, pos, from, to int) ([]byte, error)
- func NewError(pos int, b byte) error
- func Null(in []byte, pos int) (int, error)
- func Number(in []byte, pos int) (int, error)
- func Object(in []byte, pos int) (int, error)
- func SkipSpace(in []byte, pos int) (int, error)
- func String(in []byte, pos int) (int, error)
- func TypeOf(in []byte, pos int) (jsonType, error)
- func Value(in []byte, pos int) (jsonType, int, error)
- type JSONType
- type Op
- type OpErr
- type OpFunc
Constants ¶
const ( TypeError jsonType = iota TypeObject TypeArray TypeString TypeNumber TypeBoolean TypeNull TypeUnknown )
Variables ¶
Functions ¶
func Any ¶
Any returns the position of the end of the current element that begins at pos; handles any valid json element
func Array ¶
Array returns the position of the end of the array that begins at the position specified
func AsArray ¶
AsArray accepts an []byte encoded json array as an input and returns the array's elements
func FindIndex ¶
FindIndex accepts a JSON array and return the value of the element at the specified index
func FindKey ¶
FindKey accepts a JSON object and returns the value associated with the key specified
func FindKey2 ¶
FindKey2 accepts a JSON object and returns the value associated with the key specified
Types ¶
type Op ¶
Op defines a single transformation to be applied to a []byte
func Parse ¶
Parse takes a string representation of a selector and returns the corresponding Op definition
func ParseArray ¶
type OpFunc ¶
OpFunc provides a convenient func type wrapper on Op
func Dot ¶
Dot extract the specific key from the map provided; to extract a nested value, use the Dot Op in conjunction with the Chain Op