gslb_conf

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2022 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrGslbNoHostname = errors.New("no HostName")
	ErrGslbNoTs       = errors.New("no Ts")
)

Functions

func GslbConfCheck

func GslbConfCheck(conf GslbConf) error

GslbConfCheck check GslbConf.

func GslbConfNilCheck

func GslbConfNilCheck(conf GslbConf) error

Types

type GslbClusterConf

type GslbClusterConf map[string]int // sub_cluster_name => weight

GslbClusterConf is gslb conf for one cluster

func (GslbClusterConf) Check

func (conf GslbClusterConf) Check() error

Check check GslbClusterConf conf.

func (GslbClusterConf) HasDiff

func (conf GslbClusterConf) HasDiff(compared GslbClusterConf) bool

func (GslbClusterConf) IsSame

func (conf GslbClusterConf) IsSame(compared GslbClusterConf) bool

type GslbClustersConf

type GslbClustersConf map[string]GslbClusterConf // cluster_name => conf

GslbClustersConf is gslb conf for multiple clusters

func (GslbClustersConf) Check

func (conf GslbClustersConf) Check() error

func (GslbClustersConf) HasDiff

func (gslb GslbClustersConf) HasDiff(compared GslbClustersConf) bool

type GslbConf

type GslbConf struct {
	Clusters *GslbClustersConf // gslb conf for multiple clusters

	// hostname of gslb scheduler,
	// e.g., "gslb-sch.example.com"
	Hostname *string
	Ts       *string // timestamp, e.g., "20140516151616"
}

GslbConf is conf of GSLB

func GslbConfLoad

func GslbConfLoad(filename string) (GslbConf, error)

GslbConfLoad load gslb config from file.

func (*GslbConf) Check

func (conf *GslbConf) Check() error

func (GslbConf) IsSub

func (gslbConf GslbConf) IsSub(compared GslbConf) bool

IsSub compare two GslbConf and return true if compared contains all cluster in gslbConf and cluster has same GslbClusterConf.

Jump to

Keyboard shortcuts

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