jsonpath

package
v0.10.0 Latest Latest
Warning

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

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

Documentation

Overview

Package jsonpath addresses values inside a decoded-JSON tree (map[string]any / []any, as produced by encoding/json into an any) using a small, dependency-free subset of JSONPath. It supports dotted member access ($.a.b), bracketed member access ($['a']["b"]), and numeric indexing ($.a[0]). A non-resolving path yields no value rather than an error, so it is safe to probe optional fields.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Eval

func Eval(root any, path string) (any, bool)

Eval addresses a value in a decoded-JSON tree. It supports dotted member access ($.a.b), bracketed access ($['a']['b']), and numeric indexing ($.a[0]). It returns (value, true) on a resolving path, or (nil, false) when the path does not resolve — a non-resolving path simply yields no value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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