Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultJSONPathParser = NewJSONPathParser()
Functions ¶
func RelaxedJSONPathExpression ¶
copied from kubectl
Types ¶
type JSONPathFields ¶
type JSONPathFields struct {
// contains filtered or unexported fields
}
JSONPathFields is a struct that holds a JSONPathParser instance and the data to be queried by JSONPath expressions.
func NewJSONPathFields ¶
func NewJSONPathFields(jpParser *JSONPathParser, data interface{}) *JSONPathFields
NewJSONPathFields creates and returns a new instance of JSONPathFields with the given parser and data.
func (JSONPathFields) Get ¶
func (fs JSONPathFields) Get(fieldPath string) (value string)
Get retrieves the value at the specified JSONPath expression from the data and returns it as a string.
func (JSONPathFields) Has ¶
func (fs JSONPathFields) Has(fieldPath string) (exists bool)
Has checks if the given JSONPath expression exists in the data, returning a boolean indicating its existence.
type JSONPathParser ¶
JSONPathParser is a struct that holds a cache of parsed JSONPath expressions for efficient reuse.
func NewJSONPathParser ¶
func NewJSONPathParser() *JSONPathParser
NewJSONPathParser creates and returns a new instance of JSONPathParser with an empty cache.
Click to show internal directories.
Click to hide internal directories.