configuration

package
v0.0.0-...-fcb0166 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2017 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package configuration provides functions to create and load configurations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration interface {
	// GetCondition returns a named condition from the configuration, if it
	// finds it.
	//
	// Any attempt to close the returned the condition is without effect.
	GetCondition(name string) conditional.Condition

	// AddCondition adds a named condition to the configuration.
	//
	// The caller should never use the passed-in condition directly ever again.
	AddCondition(name string, condition conditional.Condition) error

	// Watch the configuration triggers until the specified context expires or
	// the watch fails.
	Watch(ctx context.Context) error

	// Clear the configuration, freeing any resource associated with it.
	//
	// The configuration can be reused again after a call to Clear.
	Clear()

	// Close the configuration.
	//
	// Must be called when the configuration is no longer needed, to free all
	// its resources.
	Close()
}

Configuration represents a configuration.

func Decode

func Decode(data interface{}) (Configuration, error)

Decode a configuration.

func Load

func Load(r io.Reader) (Configuration, error)

Load a configuration from the specified reader, as a YAML stream.

func New

func New() Configuration

New creates a new empty configuration.

Jump to

Keyboard shortcuts

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