config

package
v0.0.0-...-6eef5cf Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2014 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Reads the pod configuration from etcd using the Kubernetes etcd schema

Reads the pod configuration from file or a directory of files

Reads the pod configuration from an HTTP GET response

Index

Constants

View Source
const (
	// PodConfigNotificationSnapshot delivers the full configuration as a SET whenever
	// any change occurs
	PodConfigNotificationSnapshot = iota
	// PodConfigNotificationSetsAndUpdates delivers an UPDATE message whenever pods are
	// changed, and a SET message if there are any additions or removals.
	PodConfigNotificationSnapshotAndUpdates
	// PodConfigNotificationIncremental delivers ADD, UPDATE, and REMOVE to the update channel
	PodConfigNotificationIncremental
)

Variables

This section is empty.

Functions

func EtcdKeyForHost

func EtcdKeyForHost(hostname string) string

Types

type ListenerFunc

type ListenerFunc func(update kubelet.PodUpdate)

ListenerFunc implements the PodConfigListener interface

func (ListenerFunc) OnUpdate

func (h ListenerFunc) OnUpdate(update kubelet.PodUpdate)

type PodConfig

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

PodConfig is a configuration mux that merges many sources of pod configuration into a single consistent structure, and then delivers incremental change notifications to listeners in order.

func NewPodConfig

func NewPodConfig(mode PodConfigNotificationMode) *PodConfig

NewPodConfig creates an object that can merge many configuration sources into a stream of normalized updates to a pod configuration.

func (*PodConfig) Channel

func (c *PodConfig) Channel(source string) chan<- interface{}

Channel creates or returns a config source channel. The channel only accepts PodUpdates

func (*PodConfig) Sync

func (c *PodConfig) Sync()

Sync requests the full configuration be delivered to the update channel.

func (*PodConfig) Updates

func (c *PodConfig) Updates() <-chan kubelet.PodUpdate

Updates returns a channel of updates to the configuration, properly denormalized.

type PodConfigListener

type PodConfigListener interface {
	// OnUpdate is invoked when the kubelet.Pod configuration has been changed by one of
	// the sources. The update is properly normalized to remove duplicates.
	OnUpdate(pod kubelet.PodUpdate)
}

PodConfigListener receives notifications for changes to a configuration.

type PodConfigNotificationMode

type PodConfigNotificationMode int

PodConfigNotificationMode describes how changes are sent to the update channel

type SourceEtcd

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

TODO(lavalamp): Use a watcher interface instead of the etcd client directly

func NewSourceEtcd

func NewSourceEtcd(key string, client tools.EtcdClient, period time.Duration, updates chan<- interface{}) *SourceEtcd

NewSourceEtcd creates a config source that watches and pulls from a key in etcd

type SourceFile

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

func NewSourceFile

func NewSourceFile(path string, period time.Duration, updates chan<- interface{}) *SourceFile

type SourceURL

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

func NewSourceURL

func NewSourceURL(url string, period time.Duration, updates chan<- interface{}) *SourceURL

Jump to

Keyboard shortcuts

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