config

package
v1.5.12 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	CF = "cloudflare"
)

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.

Types

type Config

type Config struct {
	CloudConfig    string
	CloudConfigCA  string
	Addr           string
	Portmap        int
	Role           string
	AdvertisedHost string
	StatsPeriod    time.Duration
	StatshubAddr   string
	InstanceId     string
	Country        string
	StatsAddr      string
	CpuProfile     string
	MemProfile     string
	Client         *client.ClientConfig
	// contains filtered or unexported fields
}

func LoadFromDisk

func LoadFromDisk() (*Config, error)

LoadFromDisk loads a Config from flashlight.yaml inside the configured configDir with default values populated as necessary. If the file couldn't be loaded for some reason, this function returns a new default Config. This function assumes that flag.Parse() has already been called.

func (*Config) ApplyFlags

func (orig *Config) ApplyFlags() *Config

ApplyFlags updates this Config from any command-line flags that were passed in. ApplyFlags assumes that flag.Parse() has already been called.

func (*Config) HasChangedOnDisk

func (cfg *Config) HasChangedOnDisk() bool

HasChangedOnDisk checks whether Config has changed on disk

func (*Config) IsDownstream

func (cfg *Config) IsDownstream() bool

func (*Config) IsUpstream

func (cfg *Config) IsUpstream() bool

func (*Config) SaveToDisk

func (cfg *Config) SaveToDisk() error

SaveToDisk saves this Config to the file from which it was loaded.

func (*Config) UpdatedFrom

func (orig *Config) UpdatedFrom(updateBytes []byte) (*Config, error)

UpdatedFrom creates a new Config by merging the given yaml into this Config. Any servers in the updated yaml replace ones in the original Config and any masquerade sets in the updated yaml replace ones in the original Config.

Jump to

Keyboard shortcuts

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