pkg

package
v0.0.0-...-662cfd8 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JsonValue

type JsonValue struct {
	String *string
	Number *int // who cares about floats
	Bool   *bool
	Null   bool
	Object *map[string]JsonValue
	Array  *[]JsonValue
}

func Array

func Array(a []JsonValue) JsonValue

func Bool

func Bool(b bool) JsonValue

func Null

func Null() JsonValue

func Number

func Number(i int) JsonValue

func Object

func Object(o map[string]JsonValue) JsonValue

func String

func String(s string) JsonValue

func (*JsonValue) Get

func (j *JsonValue) Get(path []*PathStep) *JsonValue

type Match

type Match struct {
	Path  []*PathStep
	Value JsonValue
}

func Traverse

func Traverse(value JsonValue, matcher Matcher) []*Match

func TraverseHelp

func TraverseHelp(path []*PathStep, value JsonValue, matcher Matcher) ([]*Match, bool)

type Matcher

type Matcher func(path []*PathStep, value JsonValue, step *PathStep) ([]*Match, bool)

func MatchAllKeys

func MatchAllKeys() Matcher

func MatchFirst

func MatchFirst(matcher Matcher) Matcher

func MatchFirstKey

func MatchFirstKey() Matcher

func MatchKey

func MatchKey(key string) Matcher

func MatchPredicate

func MatchPredicate(pred func(path []*PathStep, value JsonValue, step *PathStep) bool) Matcher

type PathStep

type PathStep struct {
	MapKey     *string
	ArrayIndex *int
}

Jump to

Keyboard shortcuts

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