configmap

package
v0.13.7 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadInt added in v0.13.0

func ReadInt(requests []ReadIntRequest, config *corev1.ConfigMap) error

ReadInt reads int values from a given configmap according to the specs.

Types

type DefaultConstructor

type DefaultConstructor struct {
	// Default is the default value to use for the ConfigMap if a real one does not exist. Its name
	// is used to determine which ConfigMap to watch.
	Default v1.ConfigMap
	// Constructor follows the same interface as configmap.DefaultConstructor's value.
	Constructor interface{}
}

DefaultConstructor defines a default ConfigMap to use if the real ConfigMap does not exist and the constructor to use to parse both the default and any real ConfigMap with that name.

type DefaultUntypedStore

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

DefaultUntypedStore is an UntypedStore with default values for ConfigMaps that do not exist.

func NewDefaultUntypedStore

func NewDefaultUntypedStore(
	name string,
	logger configmap.Logger,
	defaultConstructors []DefaultConstructor,
	onAfterStore ...func(name string, value interface{})) *DefaultUntypedStore

NewDefaultUntypedStore creates a new DefaultUntypedStore.

func (*DefaultUntypedStore) WatchConfigs

func (s *DefaultUntypedStore) WatchConfigs(w configmap.Watcher)

WatchConfigs uses the provided configmap.DefaultingWatcher to setup watches for the config maps provided in defaultCMs.

type ReadIntRequest added in v0.13.0

type ReadIntRequest struct {
	// Key in the configmap to read.
	Key string
	// Field is the int field to set.
	Field *int
	// DefaultValue is the default value to use if Key doesn't exist.
	DefaultValue int
}

ReadIntRequest specifies the key to read from a configmap. Its value is set to the Field.

Jump to

Keyboard shortcuts

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