Documentation
¶
Index ¶
- type JQ
- func (jq *JQ) Query(exp string) (interface{}, error)
- func (jq *JQ) QueryToArray(exp string) ([]interface{}, error)
- func (jq *JQ) QueryToBool(exp string) (bool, error)
- func (jq *JQ) QueryToFloat64(exp string) (float64, error)
- func (jq *JQ) QueryToInt64(exp string) (int64, error)
- func (jq *JQ) QueryToMap(exp string) (map[string]interface{}, error)
- func (jq *JQ) QueryToString(exp string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JQ ¶
type JQ struct {
Data interface{}
}
JQ (JSON Query) struct
func NewFileQuery ¶
NewFileQuery - Create a new &JQ from a JSON file.
func NewQuery ¶
func NewQuery(jsonObject interface{}) *JQ
NewQuery - Create a &JQ from an interface{} parsed by json.Unmarshal
func NewStringQuery ¶
NewStringQuery - Create a new &JQ from a raw JSON string.
func (*JQ) Query ¶
Query queries against the JSON with the expression passed in. The exp is separated by dots (".")
func (*JQ) QueryToArray ¶
QueryToMap queries against the JSON with the expression passed in, and convert to a array: []interface{}
func (*JQ) QueryToBool ¶
QueryToMap queries against the JSON with the expression passed in, and convert to bool
func (*JQ) QueryToFloat64 ¶
QueryToMap queries against the JSON with the expression passed in, and convert to float64
func (*JQ) QueryToInt64 ¶
QueryToMap queries against the JSON with the expression passed in, and convert to int64
func (*JQ) QueryToMap ¶
QueryToMap queries against the JSON with the expression passed in, and convert to a map[string]interface{}