switches

package
v0.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2021 License: Apache-2.0 Imports: 4 Imported by: 3

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

View Source
const (
	All = "*"
)

Variables

This section is empty.

Functions

func Disable

func Disable(name string) string

Disable prepends disablePrefix prefix to an item name

Types

type Switches

type Switches struct {
	// contains filtered or unexported fields
}

func New

func New(settings []string) *Switches

New creates an instance of Switches

func (*Switches) All

func (s *Switches) All() sets.String

All returns names of all items set in settings

func (*Switches) DisabledByDefault

func (s *Switches) DisabledByDefault() sets.String

DisabledByDefault returns names of all disabled items

func (*Switches) Enabled

func (s *Switches) Enabled(name string) bool

Enabled checks if item is enabled

func (*Switches) Set

func (s *Switches) Set(val string) error

func (*Switches) String

func (s *Switches) String() string

func (*Switches) Type

func (s *Switches) Type() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL