 Documentation
      ¶
      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 ExtractFieldPathAsString ¶
ExtractFieldPathAsString extracts the field from the given object and returns it as a string. The object must be a pointer to an API type.
func SplitMaybeSubscriptedPath ¶ added in v1.9.0
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.