Help us shape the future of Go! Take the 2026 Go Developer Survey

node

package
v1.9.5 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotation

type Annotation struct {
	Key   AnnotationKey
	Value any
}

type AnnotationKey

type AnnotationKey struct {
	Lens string
	Name string
}

type Kind

type Kind uint8
const (
	KindNull Kind = iota
	KindBool
	KindNumber
	KindString
	KindArray
	KindObject
)

func (Kind) String

func (k Kind) String() string

type Node

type Node struct {
	Kind  Kind
	Key   string
	Index int
	Raw   string

	Children []*Node
	Parent   *Node
	// contains filtered or unexported fields
}

func (*Node) Annotate

func (n *Node) Annotate(a Annotation)

func (*Node) CountNodes

func (n *Node) CountNodes() int

func (*Node) GetAnnotation

func (n *Node) GetAnnotation(lens, name string) (any, bool)

func (*Node) GetAnnotations

func (n *Node) GetAnnotations(lens string) []Annotation

func (*Node) MarshalJSON

func (n *Node) MarshalJSON() ([]byte, error)

func (*Node) Path

func (n *Node) Path() string

func (*Node) ToAny

func (n *Node) ToAny() any

func (*Node) Walk

func (n *Node) Walk(fn func(*Node) bool)

func (*Node) WalkPost

func (n *Node) WalkPost(fn func(*Node))

Jump to

Keyboard shortcuts

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