json

package
v0.0.0-debug-20260702 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustMarshal

func MustMarshal(v interface{}) []byte

MustMarshal must marshal json

func MustUnmarshal added in v0.7.0

func MustUnmarshal(data []byte, v interface{})

MustUnmarshal must unmarshal json

func Pretty

func Pretty(v interface{}) []byte

Pretty pretty json

func RunJQ

func RunJQ(jq *gojq.Query, data any) (any, error)

RunJQ run jq on data. If the result is a single value, return the value. otherwise, return the array of values.

func RunJQFloat

func RunJQFloat(jq string, data string) (float64, error)

RunJQInt run jq on data and return the float64 value.

func RunJQInt

func RunJQInt(jq string, data string) (int, error)

RunJQInt run jq on data and return the int value.

func RunJQOnAny

func RunJQOnAny(jq string, data any) (any, error)

RunJQOnAny run jq on data. If the result is a single value, return the value. otherwise, return the array of values. The input data must be a value that is unmarshalled from a valid json string.

func RunJQOnString

func RunJQOnString(jq string, data string) (any, error)

RunJQOnString run jq on data. If the result is a single value, return the value. otherwise, return the array of values. The input data must be a valid json string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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