kubernetes: k8s.io/kubernetes/pkg/util/config Index | Files

package config

import "k8s.io/kubernetes/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.


Package Files

config.go doc.go

type Accessor Uses

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 Uses

type AccessorFunc func() interface{}

AccessorFunc implements the Accessor interface.

func (AccessorFunc) MergedState Uses

func (f AccessorFunc) MergedState() interface{}

type Broadcaster Uses

type Broadcaster struct {
    // contains filtered or unexported fields

func NewBroadcaster Uses

func NewBroadcaster() *Broadcaster

NewBroadcaster registers a set of listeners that support the Listener interface and notifies them all on changes.

func (*Broadcaster) Add Uses

func (b *Broadcaster) Add(listener Listener)

Add registers listener to receive updates of changes.

func (*Broadcaster) Notify Uses

func (b *Broadcaster) Notify(instance interface{})

Notify notifies all listeners.

type Listener Uses

type Listener interface {
    // OnUpdate is invoked when a change is made to an object.
    OnUpdate(instance interface{})

type ListenerFunc Uses

type ListenerFunc func(instance interface{})

ListenerFunc receives a representation of the change or object.

func (ListenerFunc) OnUpdate Uses

func (f ListenerFunc) OnUpdate(instance interface{})

type MergeFunc Uses

type MergeFunc func(source string, update interface{}) error

MergeFunc implements the Merger interface

func (MergeFunc) Merge Uses

func (f MergeFunc) Merge(source string, update interface{}) error

type Merger Uses

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 Uses

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 Uses

func NewMux(merger Merger) *Mux

NewMux creates a new mux that can merge changes from multiple sources.

func (*Mux) Channel Uses

func (m *Mux) Channel(source string) chan interface{}

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.

Package config imports 2 packages (graph) and is imported by 318 packages. Updated 2018-07-09. Refresh now. Tools for package owners.