Documentation ¶
Index ¶
- Constants
- Variables
- func CreateInstance(cfg *models.InstanceConfig) (*models.Instance, error)
- func DeleteInstance(name string) error
- func GetInstance(name string) (*models.Instance, error)
- func GossipCreateInstance(inst *models.Instance) error
- func GossipDeleteInstance(inst string)
- func GossipInstanceStatus(inst string, status string)
- func GossipModifyInstance(inst *models.Instance) error
- func GossipNodeEndpoint()
- func GossipNodeStatus()
- func GossipStartInstance(inst string)
- func GossipStopInstance(inst string)
- func ListInstances(fuzzyName *string) []*models.Instance
- func LoadConfig(conf string)
- func LoadInstances()
- func ModifyInstance(cfg *models.InstanceConfig) (*models.Instance, error)
- func RemoveInstancesStatus(node string)
- func RemoveNodeEndpoint(node string)
- func RemoveNodeStatus(node string)
- func StartClusterGossip() error
- func StartInstance(name string) (*models.Instance, error)
- func StopInstance(name string) (*models.Instance, error)
- func SyncInstance(other *models.Instance) error
- func SyncInstances(others []*models.Instance)
- func UpdateClusterInstance()
- func UpdateInstanceStatus(node string, instName string, newStatus string)
- func UpdateNodeEndpoint(node string, nodeIp string, nodePort uint16)
- func UpdateNodeStatus(node string, status string)
- type ClusterConfig
- type HAProxyConfig
- type HAProxyDefaultsConfig
- type HAProxyGlobalConfig
- type HAProxyTimeoutConfig
- type KeepalivedConfig
- type KeepalivedGlobalDefs
- type NodeEndpoint
Constants ¶
View Source
const ( MsgTypeCreateInstance byte = 'c' MsgTypeModifyInstance byte = 'm' MsgTypeDeleteInstance byte = 'd' MsgTypeStopInstance byte = 'p' MsgTypeStartInstance byte = 'r' MsgTypeInstanceStatus byte = 's' MsgTypeNodeStatus byte = 'S' MsgTypeNodeEndpoint byte = 'e' )
View Source
const ( ReadyStatusReady = "ready" ReadyStatusNotReady = "not_ready" ReadyStatusStarting = "starting" )
Variables ¶
View Source
var LB = struct { Name string `yaml:"name"` Host string `yaml:"host"` Port uint16 `yaml:"port"` TLSHost string `yaml:"tls_host"` TLSPort uint16 `yaml:"tls_port"` TLSCert string `yaml:"tls_cert"` TLSKey string `yaml:"tls_key"` TLSCACert string `yaml:"tls_ca_cert"` InstanceDir string `yaml:"instance_dir"` WatchInterval uint16 `yaml:"watch_interval"` LogLevel uint8 `yaml:"log_level"` Cluster ClusterConfig `yaml:"cluster"` HAProxy HAProxyConfig `yaml:"haproxy"` Keepalived KeepalivedConfig `yaml:"keepalived"` Status models.ReadyStatus `yaml:"status,omitempty"` }{}
Functions ¶
func CreateInstance ¶
func CreateInstance(cfg *models.InstanceConfig) (*models.Instance, error)
func DeleteInstance ¶
func GossipCreateInstance ¶
func GossipDeleteInstance ¶
func GossipDeleteInstance(inst string)
func GossipInstanceStatus ¶
func GossipModifyInstance ¶
func GossipNodeEndpoint ¶
func GossipNodeEndpoint()
func GossipNodeStatus ¶
func GossipNodeStatus()
func GossipStartInstance ¶
func GossipStartInstance(inst string)
func GossipStopInstance ¶
func GossipStopInstance(inst string)
func ListInstances ¶
func LoadConfig ¶
func LoadConfig(conf string)
func LoadInstances ¶
func LoadInstances()
func ModifyInstance ¶
func ModifyInstance(cfg *models.InstanceConfig) (*models.Instance, error)
func RemoveInstancesStatus ¶
func RemoveInstancesStatus(node string)
func RemoveNodeEndpoint ¶
func RemoveNodeEndpoint(node string)
func RemoveNodeStatus ¶
func RemoveNodeStatus(node string)
func StartClusterGossip ¶
func StartClusterGossip() error
func SyncInstance ¶
func SyncInstances ¶
func UpdateInstanceStatus ¶
func UpdateNodeEndpoint ¶
func UpdateNodeStatus ¶
Types ¶
type ClusterConfig ¶
type ClusterConfig struct { Name string `yaml:"name"` Endpoint string `yaml:"endpoint"` Advertize string `yaml:"advertize"` Member string `yaml:"member"` SecretKey string `yaml:"secret_key"` ProbeInterval uint16 `yaml:"probe_interval"` SyncInterval uint16 `yaml:"sync_interval"` RetransmitMult uint16 `yaml:"retransmit_mult"` Nodes map[string]NodeEndpoint `yaml:"nodes,omitempty"` }
type HAProxyConfig ¶
type HAProxyConfig struct { ConfigDir string `yaml:"config_dir"` PidDir string `yaml:"pid_dir"` StartTimeout int `yaml:"start_timeout"` GlobalConfig HAProxyGlobalConfig `yaml:"global"` DefaultsConfig HAProxyDefaultsConfig `yaml:"defaults"` }
type HAProxyDefaultsConfig ¶
type HAProxyGlobalConfig ¶
type HAProxyTimeoutConfig ¶
type KeepalivedConfig ¶
type KeepalivedConfig struct { ConfigFile string `yaml:"config_file"` ConfigDir string `yaml:"config_dir"` PidFile string `yaml:"pid_file"` GlobalDefs KeepalivedGlobalDefs `yaml:"global_defs"` MinVirtualRouterId uint8 `yaml:"min_virtual_router_id"` MaxVirtualRouterId uint8 `yaml:"max_virtual_router_id"` AdvertInt uint16 `yaml:"advert_int"` AuthType string `yaml:"auth_type"` AuthPass string `yaml:"auth_pass"` }
type KeepalivedGlobalDefs ¶
type NodeEndpoint ¶
Click to show internal directories.
Click to hide internal directories.