Documentation ¶
Index ¶
- type DocumentSelector
- func (f DocumentSelector) ByAPIVersion(apiver string) DocumentSelector
- func (f DocumentSelector) ByGVK(group, version, kind string) DocumentSelector
- func (f DocumentSelector) ByKey(key, val string) DocumentSelector
- func (f DocumentSelector) ByLabel(labelSelector string) DocumentSelector
- func (f DocumentSelector) ByName(name string) DocumentSelector
- func (f DocumentSelector) ByNamespace(ns string) DocumentSelector
- func (f DocumentSelector) Filter(items []*yaml.RNode) (result []*yaml.RNode, err error)
- func (f DocumentSelector) Filters() []kio.Filter
- type ErrBadQueryFormat
- type ErrIndexOutOfBound
- type ErrLookup
- type ErrNotScalar
- type ErrQueryConversion
- type JSONPathFilter
- type LabelFilter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DocumentSelector ¶
type DocumentSelector struct {
// contains filtered or unexported fields
}
DocumentSelector RNode objects
func (DocumentSelector) ByAPIVersion ¶
func (f DocumentSelector) ByAPIVersion(apiver string) DocumentSelector
ByAPIVersion adds filter by 'apiVersion' field value
func (DocumentSelector) ByGVK ¶
func (f DocumentSelector) ByGVK(group, version, kind string) DocumentSelector
ByGVK adds filters by 'apiVersion' and 'kind; field values
func (DocumentSelector) ByKey ¶
func (f DocumentSelector) ByKey(key, val string) DocumentSelector
ByKey adds filter by specific yaml manifest key and value
func (DocumentSelector) ByLabel ¶
func (f DocumentSelector) ByLabel(labelSelector string) DocumentSelector
ByLabel adds filter to filter by labelSelector. For more details about syntax for labelSelector refer to Parse() function description from https://github.com/kubernetes/apimachinery/blob/master/pkg/labels/selector.go
func (DocumentSelector) ByName ¶
func (f DocumentSelector) ByName(name string) DocumentSelector
ByName adds filter by 'metadata.name' field value
func (DocumentSelector) ByNamespace ¶
func (f DocumentSelector) ByNamespace(ns string) DocumentSelector
ByNamespace adds filter by 'metadata.namespace' field value
func (DocumentSelector) Filters ¶
func (f DocumentSelector) Filters() []kio.Filter
Filters return list of defined filters for the selector
type ErrBadQueryFormat ¶
type ErrBadQueryFormat struct {
Msg string
}
ErrBadQueryFormat raised for JSON query errors
func (ErrBadQueryFormat) Error ¶
func (e ErrBadQueryFormat) Error() string
type ErrIndexOutOfBound ¶
ErrIndexOutOfBound returned if JSON path points to a wrong index of a list
func (ErrIndexOutOfBound) Error ¶
func (e ErrIndexOutOfBound) Error() string
type ErrLookup ¶
type ErrLookup struct {
Msg string
}
ErrLookup raised if error occurs during walk through yaml resource
type ErrNotScalar ¶
ErrNotScalar returned if value defined by key in JSON path is not scalar Error can be returned for filter queries
func (ErrNotScalar) Error ¶
func (e ErrNotScalar) Error() string
type ErrQueryConversion ¶
ErrQueryConversion returned by query conversion function
func (ErrQueryConversion) Error ¶
func (e ErrQueryConversion) Error() string
type JSONPathFilter ¶
type JSONPathFilter struct { Kind string `yaml:"kind,omitempty"` // Path is jsonpath query. See http://goessner.net/articles/JsonPath/ for // details. Path string `yaml:"path,omitempty"` // Mutator is a function which changes filtered node Mutator func([]*yaml.RNode) error // Create empty struct if path element does not exist Create bool }
JSONPathFilter returns RNode under JSON path
type LabelFilter ¶
type LabelFilter struct {
MatchExpression string
}
LabelFilter allows to filter labels based on label Selectors Uses kubernetes label selector library from apimachinery package undreneath For syntax for MatchExpression, please refer to description of Parse() function at https://github.com/kubernetes/apimachinery/blob/master/pkg/labels/selector.go