An open API service providing repository metadata for many open source software ecosystems.

Package Usage: go: github.com/vmware-labs/yaml-jsonpointer

Package yptr is a JSONPointer implementation that can walk though a yaml.Node tree. yaml.Nodes preserve comments and locations in the source and can be useful to implement editing in-place functionality that uses JSONPointer to locate the fields to be edited. It also implements a simple extension to the JSONPointers standard that handles pointers into k8s manifests which usually contain arrays whose elements are objects with a field that uniquely specifies the array entry (e.g. "name"). For example, given a JSON/YAML input document: If "k" is a field that contains a key that uniquiely identifies an element in a given array, we can select the node with the scalar 42 by first selecting the array element for which "k" has the value of "x", and then by walking to the field "v": The "~" token accepts an argument which is interpreted as JSON value to be used as "query-by-example" filter against elements of an array. The array element is selected if the query-by-example object is a (recursive) subset of the element. The ~{...} extension can potentially locate multiple matches. For example, "~{}" effectively acts as a wildcard. This library offers an API to retrieve multiple matches ("FindAll") or to fetch only one match and error if multiple matches are found ("Find"). JSONPointer is designed to locate exactly one node in the tree. This can be achieved only if the effective schema of the JSON/YAML document mandates that there is an identifying key in each array element you want to point to. Using the "Find" function effectively performs a dynamic check of that invariant.
2 versions
Latest release: almost 5 years ago
8 dependent packages

View more package details: https://packages.ecosyste.ms/registries/proxy.golang.org/packages/github.com/vmware-labs/yaml-jsonpointer

Dependent Repos 5

mkmik/knot8
define and manipulate "knobs" in K8s manifests

Size: 807 KB - Last synced: 1 day ago - Pushed: 1 day ago

vmware-archive/yaml-jsonpointer 📦
JSONPointer implementation for the gopkg.in/yaml.v3 node API

Size: 75.2 KB - Last synced: 5 months ago - Pushed: almost 4 years ago

spectrocloud/kubesplit
A opinionated simple tool to split big YAML Kubernetes files into chunks to help building helm charts

Size: 32.2 KB - Last synced: 11 months ago - Pushed: about 2 years ago

twskipper/go-yaml-edit

Size: 44.9 KB - Last synced: 11 months ago - Pushed: about 2 years ago

vmware-archive/go-yaml-edit 📦
Go library that implements surgical in-place edits of YAML source files, while preserving formatting (indentation, quoting style, comments, etc).

Size: 57.6 KB - Last synced: 5 months ago - Pushed: almost 4 years ago

KotoLLC/peacenik
An ad-free distributed social network

Size: 102 MB - Last synced: 6 months ago - Pushed: 6 months ago

kubecfg/lensed
Edit complex files in place

Size: 4.32 MB - Last synced: 1 day ago - Pushed: 1 day ago

fulcrum29/fulcrum

Size: 119 KB - Last synced: 4 months ago - Pushed: 4 months ago