Documentation ¶
Overview ¶
Package fieldpath supplies methods for extracting fields from objects given a path to a field.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractFieldPath ¶ added in v2.6.0
ExtractFieldPath extracts the field(s) from the given object and returns the value as string, along with the expanded value of any wildcard values.
Multiple keys and values are guaranteed to be sorted in key order. If a wildcard path was given, keys is not nil.
func SplitMaybeSubscriptedPath ¶
SplitMaybeSubscriptedPath checks whether the specified fieldPath is subscripted, and
- if yes, this function splits the fieldPath into path and subscript, and returns (path, subscript, true).
- if no, this function returns (fieldPath, "", false).
Example inputs and outputs:
"metadata.annotations['myKey']" --> ("metadata.annotations", "myKey", true) "metadata.annotations['a[b]c']" --> ("metadata.annotations", "a[b]c", true) "metadata.labels['']" --> ("metadata.labels", "", true) "metadata.labels" --> ("metadata.labels", "", false)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.