Documentation ¶
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 Path() string
- func WatchChanges(key string, handler func(value []byte)) error
- type AdminConfig
- type BalancerConfig
- type BigBlueButton
- type Config
- type IDB
- type Port
- type RDB
Constants ¶
const ConsulPrefix string = "consul:"
ConsulPrefix is the configuration path consul prefix
const DefaultConfigFolder = "$HOME/.b3lb"
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 ¶ added in v2.1.2
GetConsulConfig returns the consul address from the path
func IsConsulEnabled ¶ added in v2.1.2
IsConsulEnabled check if path starts with ConsulPrefix (consul:)
func WatchChanges ¶ added in v2.1.0
WatchChanges watch consul changes and execute handler on changes
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"` }
BalancerConfig represents the balancer configuration
func (*BalancerConfig) SetDefaultValues ¶
func (bc *BalancerConfig) SetDefaultValues()
SetDefaultValues initialize BalancerConfig default values
type BigBlueButton ¶
type BigBlueButton struct { Secret string `yaml:"secret" json:"secret"` RecordingsPollInterval string `yaml:"recordingsPollInterval" json:"recordingsPollInterval"` }
BigBlueButton configuration mapping
type Config ¶
type Config struct { BigBlueButton BigBlueButton `yaml:"bigbluebutton" json:"bigbluebutton"` 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 ¶ added in v2.1.2
LoadConfigFromConsul load B3LB configuration from consul provider
func (*Config) LoadInfluxDBConf ¶ added in v2.1.2
LoadInfluxDBConf load the influxdb configuration in the Config struct