Documentation ¶
Index ¶
- func ValidateIncludesExcludes(includesList, excludesList []string) []error
- func ValidateNamespaceIncludesExcludes(includesList, excludesList []string) []error
- type IncludesExcludes
- func (ie *IncludesExcludes) Excludes(excludes ...string) *IncludesExcludes
- func (ie *IncludesExcludes) ExcludesString() string
- func (ie *IncludesExcludes) GetExcludes() []string
- func (ie *IncludesExcludes) GetIncludes() []string
- func (ie *IncludesExcludes) IncludeEverything() bool
- func (ie *IncludesExcludes) Includes(includes ...string) *IncludesExcludes
- func (ie *IncludesExcludes) IncludesString() string
- func (ie *IncludesExcludes) ShouldInclude(s string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateIncludesExcludes ¶
ValidateIncludesExcludes checks provided lists of included and excluded items to ensure they are a valid set of IncludesExcludes data.
func ValidateNamespaceIncludesExcludes ¶ added in v1.7.0
ValidateNamespaceIncludesExcludes checks provided lists of included and excluded namespaces to ensure they are a valid set of IncludesExcludes data.
Types ¶
type IncludesExcludes ¶
type IncludesExcludes struct {
// contains filtered or unexported fields
}
IncludesExcludes is a type that manages lists of included and excluded items. The logic implemented is that everything in the included list except those items in the excluded list should be included. '*' in the includes list means "include everything", but it is not valid in the exclude list.
func GenerateIncludesExcludes ¶ added in v0.4.0
func GenerateIncludesExcludes(includes, excludes []string, mapFunc func(string) string) *IncludesExcludes
GenerateIncludesExcludes constructs an IncludesExcludes struct by taking the provided include/exclude slices, applying the specified mapping function to each item in them, and adding the output of the function to the new struct. If the mapping function returns an empty string for an item, it is omitted from the result.
func GetResourceIncludesExcludes ¶ added in v1.5.0
func GetResourceIncludesExcludes(helper discovery.Helper, includes, excludes []string) *IncludesExcludes
GetResourceIncludesExcludes takes the lists of resources to include and exclude, uses the discovery helper to resolve them to fully-qualified group-resource names, and returns an IncludesExcludes list.
func NewIncludesExcludes ¶
func NewIncludesExcludes() *IncludesExcludes
func (*IncludesExcludes) Excludes ¶
func (ie *IncludesExcludes) Excludes(excludes ...string) *IncludesExcludes
Excludes adds items to the excludes list
func (*IncludesExcludes) ExcludesString ¶ added in v0.5.0
func (ie *IncludesExcludes) ExcludesString() string
ExcludesString returns a string containing all of the excludes, separated by commas, or <none> if the list is empty.
func (*IncludesExcludes) GetExcludes ¶
func (ie *IncludesExcludes) GetExcludes() []string
GetExcludes returns the items in the excludes list
func (*IncludesExcludes) GetIncludes ¶
func (ie *IncludesExcludes) GetIncludes() []string
GetIncludes returns the items in the includes list
func (*IncludesExcludes) IncludeEverything ¶ added in v0.5.0
func (ie *IncludesExcludes) IncludeEverything() bool
IncludeEverything returns true if the includes list is empty or '*' and the excludes list is empty, or false otherwise.
func (*IncludesExcludes) Includes ¶
func (ie *IncludesExcludes) Includes(includes ...string) *IncludesExcludes
Includes adds items to the includes list. '*' is a wildcard value meaning "include everything".
func (*IncludesExcludes) IncludesString ¶ added in v0.5.0
func (ie *IncludesExcludes) IncludesString() string
IncludesString returns a string containing all of the includes, separated by commas, or * if the list is empty.
func (*IncludesExcludes) ShouldInclude ¶
func (ie *IncludesExcludes) ShouldInclude(s string) bool
ShouldInclude returns whether the specified item should be included or not. Everything in the includes list except those items in the excludes list should be included.