jsonutil

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Traverse

func Traverse(b string, callback TraverseCallback)

Traverse traverse json object and call the callback function

func TraverseBytes

func TraverseBytes(b []byte, callback TraverseCallback)

TraverseBytes is like Traverse but more efficient if use bytes

Types

type Key

type Key struct {
	Key  interface{}
	Type KeyType
}

Key json key

type KeyType

type KeyType int

KeyType the json key type

const (
	// String regular key-value json key type
	String KeyType = iota + 1

	// Index is array key type
	Index
)

type TraverseCallback

type TraverseCallback func(key *Key, value *gjson.Result, path []byte)

TraverseCallback callback function, will be called during traverse

Jump to

Keyboard shortcuts

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