config

package
v1.4.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2017 License: MIT Imports: 13 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 Diagnostic added in v1.4.0

type Diagnostic interface {
	Error(msg string, err 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"`
}

func (Override) MarshalBinary added in v1.2.0

func (o Override) MarshalBinary() ([]byte, error)

func (Override) ObjectID added in v1.2.0

func (o Override) ObjectID() string

func (*Override) UnmarshalBinary added in v1.2.0

func (o *Override) UnmarshalBinary(data []byte) error

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)

	Rebuild() error
}

Data access object for Override data.

type Service

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

func NewService

func NewService(c Config, config interface{}, d Diagnostic, 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