Documentation ¶
Index ¶
- Constants
- func NewTimeoutClient(connectTimeout time.Duration, readWriteTimeout time.Duration) *http.Client
- func Shuffle(n int, swap func(i, j int))
- type LBCluster
- func (lbc *LBCluster) ApplyMetric() bool
- func (lbc *LBCluster) EvaluateHosts(hostsToCheck map[string]lbhost.LBHost)
- func (lbc *LBCluster) FindBestHosts(hosts_to_check map[string]lbhost.LBHost) bool
- func (lbc *LBCluster) GetStateDNS(dnsManager string) error
- func (lbc *LBCluster) Get_list_hosts(current_list map[string]lbhost.LBHost)
- func (lbc *LBCluster) RefreshDNS(dnsManager, keyPrefix, internalKey, externalKey string)
- func (lbc *LBCluster) Time_to_refresh() bool
- func (lbc *LBCluster) Write_to_log(level string, msg string) error
- type Log
- type Logger
- type Node
- type NodeList
- type Params
Constants ¶
View Source
const OID string = ".1.3.6.1.4.1.96.255.1"
OID snmp object to get
View Source
const TIMEOUT int = 10
TIMEOUT snmp timeout
View Source
const WorstValue int = 99999
WorstValue worst possible load
Variables ¶
This section is empty.
Functions ¶
func NewTimeoutClient ¶
NewTimeoutClient checks the timeout
The following functions are for the roger state and its timeout
Types ¶
type LBCluster ¶
type LBCluster struct { Cluster_name string Loadbalancing_username string Loadbalancing_password string Host_metric_table map[string]Node Parameters Params Time_of_last_evaluation time.Time Current_best_ips []net.IP Previous_best_ips_dns []net.IP Current_index int Slog *Log }
LBCluster struct of an lbcluster alias
func (*LBCluster) ApplyMetric ¶ added in v0.2.1
ApplyMetric This is the core of the lbcluster: based on the metrics, select the best hosts
func (*LBCluster) EvaluateHosts ¶ added in v0.2.1
EvaluateHosts gets the load from the all the nodes
func (*LBCluster) FindBestHosts ¶ added in v0.2.1
Find_best_hosts Looks for the best hosts for a cluster
func (*LBCluster) GetStateDNS ¶ added in v0.2.1
func (*LBCluster) Get_list_hosts ¶ added in v0.1.14
Get_list_hosts Get the hosts for an alias
func (*LBCluster) RefreshDNS ¶ added in v0.2.1
RefreshDNS This is the only public function here. It retrieves the current ips behind the dns, and then updates it with the new best ips (if they are different)
func (*LBCluster) Time_to_refresh ¶
Time_to_refresh Checks if the cluster needs refreshing
type Log ¶
type Log struct { Writer syslog.Writer Syslog bool Stdout bool Debugflag bool TofilePath string // contains filtered or unexported fields }
Log struct for the log
type Logger ¶
type Logger interface { Info(s string) error Warning(s string) error Debug(s string) error Error(s string) error }
Logger struct for the Logger interface
Click to show internal directories.
Click to hide internal directories.