Documentation ¶
Index ¶
- type JQ
- func (jq *JQ) Query(exp string) (any, error)
- func (jq *JQ) QueryToArray(exp string) ([]any, 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]any, 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 any
}
JQ (JSON Query) struct
func NewFileQuery ¶
NewFileQuery - Create a new &JQ from a JSON file.
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: []any
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]any