Documentation ¶
Overview ¶
Package config manages the bigblueswarm config
Package config manages the bigblueswarm config ¶
Package config manages the bigblueswarm config
Index ¶
- Constants
- func ConsulKey(conf string) string
- func DefaultConfigPath() string
- func FormalizeConfigPath(path string) (string, error)
- func GetConsulConfig(path string) *api.Config
- func IsConsulEnabled(path string) bool
- func SetConsulConfig(config *api.Config)
- func WatchChanges(logger *log.Entry, key string, handler func(value []byte)) error
- type AdminConfig
- type BalancerConfig
- type BigBlueSwarm
- type Config
- type IDB
- type Port
- type RDB
Constants ¶
const ConsulPrefix string = "consul:"
ConsulPrefix is the configuration path consul prefix
const DefaultConfigFolder = "$HOME/.bigblueswarm"
DefaultConfigFolder is the default config folder path
Variables ¶
This section is empty.
Functions ¶
func DefaultConfigPath ¶
func DefaultConfigPath() string
DefaultConfigPath return the default config path file
func FormalizeConfigPath ¶
FormalizeConfigPath formalize config path. If config path is the default config path (home directory), it returns a computed path
func GetConsulConfig ¶
GetConsulConfig returns the consul address from the path
func IsConsulEnabled ¶
IsConsulEnabled check if path starts with ConsulPrefix (consul:)
func SetConsulConfig ¶ added in v2.2.1
SetConsulConfig set the consul configuration
Types ¶
type AdminConfig ¶
type AdminConfig struct {
APIKey string `yaml:"apiKey" json:"apiKey"`
}
AdminConfig represents the admin configuration
type BalancerConfig ¶
type BalancerConfig struct { MetricsRange string `yaml:"metricsRange" json:"metricsRange"` CPULimit int `yaml:"cpuLimit" json:"cpuLimit"` MemLimit int `yaml:"memLimit" json:"memLimit"` AggregationInterval string `yaml:"aggregationInterval" json:"aggregationInterval"` }
BalancerConfig represents the balancer configuration
func (*BalancerConfig) SetDefaultValues ¶
func (bc *BalancerConfig) SetDefaultValues()
SetDefaultValues initialize BalancerConfig default values
type BigBlueSwarm ¶ added in v2.3.0
type BigBlueSwarm struct { Secret string `yaml:"secret" json:"secret"` RecordingsPollInterval string `yaml:"recordingsPollInterval" json:"recordingsPollInterval"` }
BigBlueSwarm configuration mapping
func (*BigBlueSwarm) SetDefaultValues ¶ added in v2.3.0
func (bbs *BigBlueSwarm) SetDefaultValues()
SetDefaultValues initialize BigBlueSwarm default values
type Config ¶
type Config struct { BigBlueSwarm BigBlueSwarm `yaml:"bigblueswarm" json:"bigblueswarm"` Admin AdminConfig `yaml:"admin" json:"admin"` Balancer BalancerConfig `yaml:"balancer" json:"balancer"` Port Port `yaml:"port" json:"port"` RDB RDB `yaml:"redis" json:"redis"` IDB IDB `yaml:"influxdb" json:"influxdb"` }
Config represents main configuration mapping
func LoadConfigFromConsul ¶
LoadConfigFromConsul load BigBlueSwarm configuration from consul provider
func (*Config) LoadInfluxDBConf ¶
LoadInfluxDBConf load the influxdb configuration in the Config struct