func InitVlan() { Devices = consistent.New() for _, device := range g.Config.VLan.Physical { Devices.Add(device) } logs.Info("Vlan initiated") }
func InitTransfers() { Transfers = consistent.New() for _, transfer := range Config.Metrics.Transfers { Transfers.Add(transfer) } logs.Info("Metrics initiated") }
func NewVLanSetter() *VLanSetter { v := &VLanSetter{} v.Devices = consistent.New() for _, device := range config.VLan.Physical { v.Devices.Add(device) } return v }
func NewMetricsRecorder(hostname string, config defines.MetricsConfig) *MetricsRecorder { r := &MetricsRecorder{} r.hostname = hostname r.apps = map[string]struct{}{} r.transfers = consistent.New() r.step = time.Duration(config.Step) * time.Second r.rpcTimeout = time.Duration(config.Timeout) * time.Millisecond for _, transfer := range config.Transfers { r.transfers.Add(transfer) } return r }
func (s *Route) LoadBackends() { s.Backends = consistent.New() for _, addr := range s.Target.Addrs { s.Backends.Add(addr) } }
func InitTransfers() { Transfers = consistent.New() for _, transfer := range Config().Transfer.Addrs { Transfers.Add(transfer) } }