Documentation ¶
Index ¶
- func AllClusterBackendCheck(conf *AllClusterBackend) error
- func BackendConfCheck(conf *BackendConf) error
- func ClusterTableConfCheck(conf ClusterTableConf) error
- func ClusterTableDump(conf ClusterTableConf, filename string) error
- type AllClusterBackend
- func (conf *AllClusterBackend) Check() error
- func (allClusterBackend AllClusterBackend) HasDiff(compared AllClusterBackend) bool
- func (allClusterBackend AllClusterBackend) IsSub(compared AllClusterBackend) bool
- func (allClusterBackend AllClusterBackend) Shuffle()
- func (allClusterBackend AllClusterBackend) Sort()
- type BackendConf
- type ClusterBackend
- type ClusterTableConf
- type SubClusterBackend
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllClusterBackendCheck ¶
func AllClusterBackendCheck(conf *AllClusterBackend) error
AllClusterBackendCheck check AllClusterBackend config
func BackendConfCheck ¶
func BackendConfCheck(conf *BackendConf) error
BackendConfCheck check BackendConf config
func ClusterTableConfCheck ¶
func ClusterTableConfCheck(conf ClusterTableConf) error
ClusterTableConfCheck check ClusterTableConf config
func ClusterTableDump ¶
func ClusterTableDump(conf ClusterTableConf, filename string) error
ClusterTableDump dumps conf to file
Types ¶
type AllClusterBackend ¶
type AllClusterBackend map[string]ClusterBackend
func (*AllClusterBackend) Check ¶
func (conf *AllClusterBackend) Check() error
func (AllClusterBackend) HasDiff ¶
func (allClusterBackend AllClusterBackend) HasDiff(compared AllClusterBackend) bool
func (AllClusterBackend) IsSub ¶
func (allClusterBackend AllClusterBackend) IsSub(compared AllClusterBackend) bool
IsSub Compare two AllClusterBackend, return true if compared contains all cluster in allClusterBackend, and there cluster has same ClusterBackend value.
func (AllClusterBackend) Shuffle ¶
func (allClusterBackend AllClusterBackend) Shuffle()
Shuffle shuffles all the backends in allClusterBackend
func (AllClusterBackend) Sort ¶
func (allClusterBackend AllClusterBackend) Sort()
Sort sortes all the backends in allClusterBackend
type BackendConf ¶
type BackendConf struct { Name *string // e.g., "a-05.a" Addr *string // e.g., "10.26.35.33" Port *int // e.g., 8000 Weight *int // weight in load balance, e.g., 10 }
BackendConf is conf of backend
func (*BackendConf) AddrInfo ¶
func (b *BackendConf) AddrInfo() string
type ClusterBackend ¶
type ClusterBackend map[string]SubClusterBackend
func (ClusterBackend) HasDiff ¶
func (clusterBackend ClusterBackend) HasDiff(compared ClusterBackend) bool
func (ClusterBackend) IsSame ¶
func (clusterBackend ClusterBackend) IsSame(compared ClusterBackend) bool
type ClusterTableConf ¶
type ClusterTableConf struct { Version *string // version of config Config *AllClusterBackend }
ClusterTableConf is conf of cluster
func ClusterTableLoad ¶
func ClusterTableLoad(filename string) (ClusterTableConf, error)
ClusterTableLoad loads config of cluster table from file
type SubClusterBackend ¶
type SubClusterBackend []*BackendConf
func (*SubClusterBackend) Check ¶
func (sub *SubClusterBackend) Check() error
func (SubClusterBackend) Len ¶
func (s SubClusterBackend) Len() int
func (SubClusterBackend) Less ¶
func (s SubClusterBackend) Less(i, j int) bool
func (SubClusterBackend) Shuffle ¶
func (s SubClusterBackend) Shuffle()
Shuffle random shuffle backends
func (SubClusterBackend) Sort ¶
func (s SubClusterBackend) Sort()
Sort sorted backends by addr and port
func (SubClusterBackend) Swap ¶
func (s SubClusterBackend) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.