Documentation
¶
Index ¶
Constants ¶
const (
CF = "cloudflare"
)
Variables ¶
This section is empty.
Functions ¶
func InConfigDir ¶
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 ¶
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 ¶
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 ¶
HasChangedOnDisk checks whether Config has changed on disk
func (*Config) IsDownstream ¶
func (*Config) IsUpstream ¶
func (*Config) SaveToDisk ¶
SaveToDisk saves this Config to the file from which it was loaded.
func (*Config) UpdatedFrom ¶
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.