Documentation ¶
Overview ¶
Package switches provides new type that implements flag.Value interface -- Switches. It can be used for enabling/disabling controllers/webhooks in your controller manager.
Index ¶
- Constants
- func Disable(name string) string
- type Switches
- func (s *Switches) Active() sets.Set[string]
- func (s *Switches) All() sets.Set[string]
- func (s *Switches) AllEnabled(names ...string) bool
- func (s *Switches) AnyEnabled(names ...string) bool
- func (s *Switches) DisabledByDefault() sets.Set[string]
- func (s *Switches) Enabled(name string) bool
- func (s *Switches) EnabledByDefault() sets.Set[string]
- func (s *Switches) Set(val string) error
- func (s *Switches) String() string
- func (s *Switches) Type() string
- func (s *Switches) Values() map[string]bool
Constants ¶
View Source
const (
All = "*"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Switches ¶
type Switches struct {
// contains filtered or unexported fields
}
func Make ¶
Make creates an instance of Switches Same as New but returns copy of a struct, not a pointer
func (*Switches) AllEnabled ¶
AllEnabled checks whether all switches with the given names are enabled.
func (*Switches) AnyEnabled ¶
AnyEnabled checks whether any switch of the given names is enabled.
func (*Switches) DisabledByDefault ¶
DisabledByDefault returns names of all disabled items
func (*Switches) EnabledByDefault ¶
EnabledByDefault returns names of all enabled items
Click to show internal directories.
Click to hide internal directories.