config

package
v1.1.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2016 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoOverrideExists = errors.New("no override exists")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Enabled bool `toml:"enabled"`
}

func NewConfig

func NewConfig() Config

type ConfigUpdate

type ConfigUpdate struct {
	Name      string
	NewConfig []interface{}
	ErrC      chan<- error
}

type Override

type Override struct {
	// Unique identifier for the override
	ID string `json:"id"`

	// Map of key value pairs of option overrides.
	Options map[string]interface{} `json:"options"`

	Create bool `json:"create"`
}

type OverrideDAO

type OverrideDAO interface {
	// Retrieve a override
	Get(id string) (Override, error)

	// Set an override.
	// If it does not already exist it will be created,
	// otherwise it will be replaced.
	Set(o Override) error

	// Delete a override.
	// It is not an error to delete an non-existent override.
	Delete(id string) error

	// List all overrides whose ID starts with the given prefix
	List(prefix string) ([]Override, error)
}

Data access object for Override data.

type Service

type Service struct {
	StorageService interface {
		Store(namespace string) storage.Interface
	}
	HTTPDService interface {
		AddRoutes([]httpd.Route) error
		DelRoutes([]httpd.Route)
	}
	// contains filtered or unexported fields
}

func NewService

func NewService(c Config, config interface{}, l *log.Logger, updates chan<- ConfigUpdate) *Service

func (*Service) Close

func (s *Service) Close() error

func (*Service) Config

func (s *Service) Config() (map[string][]interface{}, error)

func (*Service) Open

func (s *Service) Open() error

Directories

Path Synopsis
Overrider provides an API for overriding and reading redacted values for a configuration object.
Overrider provides an API for overriding and reading redacted values for a configuration object.

Jump to

Keyboard shortcuts

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