lbcluster

package
v0.1.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2018 License: Apache-2.0, Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const OID string = ".1.3.6.1.4.1.96.255.1"
View Source
const TIMEOUT int = 10
View Source
const WorstValue int = 99999

Variables

This section is empty.

Functions

func NewTimeoutClient

func NewTimeoutClient(connectTimeout time.Duration, readWriteTimeout time.Duration) *http.Client

The following functions are for the roger state and its timeout

func Shuffle

func Shuffle(n int, swap func(i, j int))

Shuffle pseudo-randomizes the order of elements. n is the number of elements. Shuffle panics if n < 0. swap swaps the elements with indexes i and j.

Types

type LBCluster

type LBCluster struct {
	Cluster_name            string
	Loadbalancing_username  string
	Loadbalancing_password  string
	Host_metric_table       map[string]int
	Parameters              Params
	Time_of_last_evaluation time.Time
	Current_best_hosts      []string
	Previous_best_hosts     []string
	Previous_best_hosts_dns []string
	Statistics_filename     string
	Per_cluster_filename    string
	Current_index           int
	Slog                    *Log
}

func (*LBCluster) Find_best_hosts

func (self *LBCluster) Find_best_hosts(hosts_to_check map[string]lbhost.LBHost)

func (*LBCluster) Get_list_hosts added in v0.1.14

func (self *LBCluster) Get_list_hosts(current_list map[string]lbhost.LBHost)

func (*LBCluster) Refresh_dns

func (self *LBCluster) Refresh_dns(dnsManager, keyPrefix, internalKey, externalKey string, hosts_to_check map[string]lbhost.LBHost)
This is the only public function here. It retrieves the status of the dns,

and then updates it with the new hosts

func (*LBCluster) Time_to_refresh

func (self *LBCluster) Time_to_refresh() bool

func (*LBCluster) Write_to_log

func (self *LBCluster) Write_to_log(level string, msg string) error

type Log

type Log struct {
	Writer     syslog.Writer
	Syslog     bool
	Stdout     bool
	Debugflag  bool
	TofilePath string
	// contains filtered or unexported fields
}

func (*Log) Debug

func (l *Log) Debug(s string) error

func (*Log) Error

func (l *Log) Error(s string) error

func (*Log) Info

func (l *Log) Info(s string) error

func (*Log) Warning

func (l *Log) Warning(s string) error

type Logger

type Logger interface {
	Info(s string) error
	Warning(s string) error
	Debug(s string) error
	Error(s string) error
}

type Pair

type Pair struct {
	Key   string
	Value int
}

type PairList

type PairList []Pair

func (PairList) Len

func (p PairList) Len() int

func (PairList) Less

func (p PairList) Less(i, j int) bool

func (PairList) Swap

func (p PairList) Swap(i, j int)

type Params

type Params struct {
	Behaviour        string
	Best_hosts       int
	External         bool
	Metric           string
	Polling_interval int
	Statistics       string
	Ttl              int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL