Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DependentList ¶
type DependentList struct {
// contains filtered or unexported fields
}
A DependentList represents a list of dependents of a resource. Each dependent has a plural Kind and a list of names of dependent resources.
func NewDependentList ¶
func NewDependentList() *DependentList
NewDependentList creates a new empty DependentList.
func (*DependentList) Add ¶
func (d *DependentList) Add(pluralKind string, name string)
Add adds a dependent name for a plural Kind to the DependentList.
func (*DependentList) Empty ¶
func (d *DependentList) Empty() bool
Empty returns true if the DependentList is empty or false otherwise.
func (*DependentList) OfKind ¶ added in v1.8.0
func (d *DependentList) OfKind(pluralKind string) []string
OfKind returns the names of dependents of the Kind (plural), or an empty list if no dependents exist.
func (*DependentList) PluralKinds ¶
func (d *DependentList) PluralKinds() []string
PluralKinds returns the plural Kinds that have dependents.
func (*DependentList) StringWithHeader ¶
func (d *DependentList) StringWithHeader(headerFormat string, args ...interface{}) string
StringWithHeader outputs the dependent list as a pretty-printed string headed with the given formatting directive (followed by a colon). It outputs dependents in alphabetical order by the plural Kind. Example:
StringWithHeader("dependents of my %q", "mom") --> `dependents of my "mom": FirstResources: [name1], SecondResources: [name2 name2 name3]`