...

Package jsonpath

import "sigs.k8s.io/cli-utils/pkg/jsonpath"
Overview
Index

Overview ▾

func Get

func Get(obj map[string]interface{}, expression string) ([]interface{}, error)

Get evaluates the JSONPath expression to extract values from the input map. Returns the node values that were found (zero or more), or an error. For details about the JSONPath expression language, see: https://goessner.net/articles/JsonPath/

func Set

func Set(obj map[string]interface{}, expression string, value interface{}) (int, error)

Set evaluates the JSONPath expression to set a value in the input map. Returns the number of matching nodes that were updated, or an error. For details about the JSONPath expression language, see: https://goessner.net/articles/JsonPath/