package config
import "k8s.io/client-go/pkg/util/config"
Package config provides utility objects for decoupling sources of configuration and the actual configuration state. Consumers must implement the Merger interface to unify the sources of change into an object.
Index ¶
- Variables
- type Accessor
- type AccessorFunc
- type Broadcaster
- func NewBroadcaster() *Broadcaster
- func (b *Broadcaster) Add(listener Listener)
- func (b *Broadcaster) Notify(instance interface{})
- type ConfigurationMap
- func (m *ConfigurationMap) Set(value string) error
- func (m *ConfigurationMap) String() string
- func (*ConfigurationMap) Type() string
- type FeatureGate
- type Listener
- type ListenerFunc
- type MergeFunc
- type Merger
- type Mux
- type NamedCertKey
- func (nkc *NamedCertKey) Set(value string) error
- func (nkc *NamedCertKey) String() string
- func (*NamedCertKey) Type() string
- type NamedCertKeyArray
Variables ¶
var ( // DefaultFeatureGate is a shared global FeatureGate. DefaultFeatureGate = &featureGate{ known: knownFeatures, special: specialFeatures, } )
Types ¶
type Accessor ¶
type Accessor interface { // MergedState returns a representation of the current merge state. // Must be reentrant when more than one source is defined. MergedState() interface{} }
Accessor is an interface for retrieving the current merge state.
type AccessorFunc ¶
type AccessorFunc func() interface{}
AccessorFunc implements the Accessor interface.
func (AccessorFunc) MergedState ¶
func (f AccessorFunc) MergedState() interface{}
type Broadcaster ¶
type Broadcaster struct {
// contains filtered or unexported fields
}
func NewBroadcaster ¶
func NewBroadcaster() *Broadcaster
NewBroadcaster registers a set of listeners that support the Listener interface and notifies them all on changes.
func (*Broadcaster) Add ¶
func (b *Broadcaster) Add(listener Listener)
Add registers listener to receive updates of changes.
func (*Broadcaster) Notify ¶
func (b *Broadcaster) Notify(instance interface{})
Notify notifies all listeners.
type ConfigurationMap ¶
func (*ConfigurationMap) Set ¶
func (m *ConfigurationMap) Set(value string) error
func (*ConfigurationMap) String ¶
func (m *ConfigurationMap) String() string
func (*ConfigurationMap) Type ¶
func (*ConfigurationMap) Type() string
type FeatureGate ¶
type FeatureGate interface { AddFlag(fs *pflag.FlagSet) Set(value string) error KnownFeatures() []string // owner: @timstclair // beta: v1.4 AppArmor() bool // owner: @girishkalele // alpha: v1.4 ExternalTrafficLocalOnly() bool // owner: @saad-ali // alpha: v1.3 DynamicVolumeProvisioning() bool // owner: @mtaufen // alpha: v1.4 DynamicKubeletConfig() bool // owner: timstclair // alpha: v1.5 StreamingProxyRedirects() bool }
FeatureGate parses and stores flag gates for known features from a string like feature1=true,feature2=false,...
type Listener ¶
type Listener interface { // OnUpdate is invoked when a change is made to an object. OnUpdate(instance interface{}) }
type ListenerFunc ¶
type ListenerFunc func(instance interface{})
ListenerFunc receives a representation of the change or object.
func (ListenerFunc) OnUpdate ¶
func (f ListenerFunc) OnUpdate(instance interface{})
type MergeFunc ¶
MergeFunc implements the Merger interface
func (MergeFunc) Merge ¶
type Merger ¶
type Merger interface { // Invoked when a change from a source is received. May also function as an incremental // merger if you wish to consume changes incrementally. Must be reentrant when more than // one source is defined. Merge(source string, update interface{}) error }
type Mux ¶
type Mux struct {
// contains filtered or unexported fields
}
Mux is a class for merging configuration from multiple sources. Changes are pushed via channels and sent to the merge function.
func NewMux ¶
NewMux creates a new mux that can merge changes from multiple sources.
func (*Mux) Channel ¶
Channel returns a channel where a configuration source can send updates of new configurations. Multiple calls with the same source will return the same channel. This allows change and state based sources to use the same channel. Different source names however will be treated as a union.
type NamedCertKey ¶
NamedCertKey is a flag value parsing "certfile,keyfile" and "certfile,keyfile:name,name,name".
func (*NamedCertKey) Set ¶
func (nkc *NamedCertKey) Set(value string) error
func (*NamedCertKey) String ¶
func (nkc *NamedCertKey) String() string
func (*NamedCertKey) Type ¶
func (*NamedCertKey) Type() string
type NamedCertKeyArray ¶
type NamedCertKeyArray struct {
// contains filtered or unexported fields
}
NamedCertKeyArray is a flag value parsing NamedCertKeys, each passed with its own flag instance (in contrast to comma separated slices).
func NewNamedCertKeyArray ¶
func NewNamedCertKeyArray(p *[]NamedCertKey) *NamedCertKeyArray
NewNamedKeyCertArray creates a new NamedCertKeyArray with the internal value pointing to p.
func (*NamedCertKeyArray) Set ¶
func (a *NamedCertKeyArray) Set(val string) error
func (*NamedCertKeyArray) String ¶
func (a *NamedCertKeyArray) String() string
func (*NamedCertKeyArray) Type ¶
func (a *NamedCertKeyArray) Type() string
Source Files ¶
config.go configuration_map.go doc.go feature_gate.go namedcertkey_flag.go
- Version
- v2.0.0-alpha.1+incompatible
- Published
- Dec 20, 2016
- Platform
- js/wasm
- Imports
- 10 packages
- Last checked
- 22 minutes ago –
Tools for package owners.