Documentation
¶
Index ¶
- Variables
- func Compact(json string) (string, error)
- func FromJson(json string) ([]string, error)
- func FromJsonToMap(json string) (map[string]string, error)
- func NewEncoder(tab bool, indent int, monoOutput bool) *encoder
- func PrettyPrint(in string) string
- func PrintJsonAsKeyValue(json string) error
- func PrintJsonToStderr(json string) error
- func PrintJsonToStdout(json string) error
- func PrintJsonToWriter(json string, w io.Writer) error
- func RunJQ(queryStr string, result interface{}) (interface{}, error)
- func RunJQOnString(queryStr string, json string) (interface{}, error)
- func RunJQOnStringAndGetString(queryStr string, json string) (string, error)
- func RunJQOnStringAndMarshalResponse(queryStr string, json string, obj any) error
- func RunJQOnStringWithArray(queryStr string, json string) ([]interface{}, error)
- func RunJQWithArray(queryStr string, result interface{}) ([]interface{}, error)
- func ToJson(args []string, noWrapping bool, compliant bool, ...) (string, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var EmptyArray = regexp.MustCompile("^\\[]$")
View Source
var KeysToDelete = []string{
".data.links",
".data.meta",
".data[].links",
".data[].meta",
".links",
".meta",
"..|nulls",
`..|select(. == {})`,
`..|select(. == {})`,
`..|select(. == "")`,
}
View Source
var MonochromeOutput = false
View Source
var QuotedString = regexp.MustCompile("^\\\".+\\\"$")
View Source
var TreatAsLiterals = regexp.MustCompile("^(-?[0-9]+(\\.[0-9]+)?|false|true|null)$")
Functions ¶
func FromJson ¶ added in v0.14.0
FromJson is the inverse operation of ToJson it converts a json object into the key value pairs we would type on the command line
func FromJsonToMap ¶ added in v0.14.0
FromJsonToMap converts a json string into a map of key value pairs.
func NewEncoder ¶
func PrettyPrint ¶ added in v0.10.0
func PrintJsonAsKeyValue ¶ added in v0.14.0
func PrintJsonToStderr ¶ added in v0.5.0
func PrintJsonToStdout ¶ added in v0.14.0
func RunJQOnString ¶ added in v0.8.1
func RunJQOnStringAndGetString ¶ added in v0.12.0
func RunJQOnStringAndMarshalResponse ¶ added in v0.12.0
func RunJQOnStringWithArray ¶ added in v0.9.0
These copy and paste functions below, were because the existing functions were buggy if the iterator returns more than one thing, only the last is saved. it was deemed to risky to fix at the moment.
func RunJQWithArray ¶ added in v0.9.0
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.