config

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2014 License: Apache-2.0 Imports: 15 Imported by: 53

Documentation

Index

Constants

View Source
const (
	CloudConfigPollInterval = 1 * time.Minute
)

Variables

This section is empty.

Functions

func InConfigDir

func InConfigDir(filename string) string

InConfigDir returns the path to the given filename inside of the configdir.

func Update added in v1.6.0

func Update(mutate func(cfg *Config) error) error

Update updates the configuration using the given mutator function.

Types

type Config

type Config struct {
	Version       int
	CloudConfig   string
	CloudConfigCA string
	Addr          string
	Role          string
	Country       string
	StatsAddr     string
	CpuProfile    string
	MemProfile    string
	Stats         *statreporter.Config
	Server        *server.ServerConfig
	Client        *client.ClientConfig
}

func Start added in v1.6.0

func Start(updateHandler func(updated *Config)) (*Config, error)

Start starts the configuration system.

func (*Config) ApplyDefaults added in v1.6.0

func (cfg *Config) ApplyDefaults()

ApplyDefaults implements the method from interface yamlconf.Config

ApplyDefaults populates default values on a Config to make sure that we have a minimum viable config for running. As new settings are added to flashlight, this function should be updated to provide sensible defaults for those settings.

func (*Config) GetVersion added in v1.6.0

func (cfg *Config) GetVersion() int

GetVersion implements the method from interface yamlconf.Config

func (*Config) IsDownstream

func (cfg *Config) IsDownstream() bool

func (*Config) IsUpstream

func (cfg *Config) IsUpstream() bool

func (*Config) SetVersion added in v1.6.0

func (cfg *Config) SetVersion(version int)

SetVersion implements the method from interface yamlconf.Config

Jump to

Keyboard shortcuts

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