json

package
v0.11.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KeysToDelete = []string{
	".data.links",
	".data.meta",
	".data[].links",
	".data[].meta",
	".links",
	".meta",
	"..|nulls",
	`..|select(. == {})`,
	`..|select(. == {})`,
	`..|select(. == "")`,
}
View Source
var MonochromeOutput = false

Functions

func Compact added in v0.11.0

func Compact(json string) (string, error)

func NewEncoder

func NewEncoder(tab bool, indent int) *encoder

func PrettyPrint added in v0.10.0

func PrettyPrint(in string) string

func PrintJson

func PrintJson(json string) error

func PrintJsonToStderr added in v0.5.0

func PrintJsonToStderr(json string) error

func RunJQ added in v0.7.0

func RunJQ(queryStr string, result interface{}) (interface{}, error)

func RunJQOnString added in v0.8.1

func RunJQOnString(queryStr string, json string) (interface{}, error)

func RunJQOnStringWithArray added in v0.9.0

func RunJQOnStringWithArray(queryStr string, json string) ([]interface{}, error)

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

func RunJQWithArray(queryStr string, result interface{}) ([]interface{}, error)

func ToJson

func ToJson(args []string, noWrapping bool, compliant bool, attributes map[string]*resources.CrudEntityAttribute, useAliases bool) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL