Documentation ¶
Index ¶
- func AddNode(serviceName string, address string) error
- func CheckRole(name string, path, role string) bool
- func DelService(serviceName string) error
- func RmNode(serviceName string, address string) error
- func ServiceExit(name string) bool
- func UpdateServiceType(serviceName string, serviceType ServiceType) error
- type Node
- type Service
- type ServiceType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DelService ¶
func ServiceExit ¶
func UpdateServiceType ¶
func UpdateServiceType(serviceName string, serviceType ServiceType) error
Types ¶
type Node ¶
type Node struct { // 节点地址 Address string `json:"address,omitempty" yaml:"address,omitempty"` // 是否存活 Alive bool `json:"alive,omitempty" yaml:"alive,omitempty"` }
func ChooseNode ¶
type Service ¶
type Service struct { ServiceType ServiceType `json:"service_type,omitempty" yaml:"service_type,omitempty"` ServiceName string `json:"service_name,omitempty" yaml:"service_name,omitempty"` Nodes []*Node `json:"nodes,omitempty" yaml:"nodes,omitempty"` PathRole map[string][]string `json:"path_role,omitempty" yaml:"path_role,omitempty"` }
func GetAllService ¶
func GetService ¶
func GetServiceFromDisk ¶
type ServiceType ¶
type ServiceType uint8
const ( ServiceConuwaPeer ServiceType = iota ServiceEtcd ServiceRedis ServiceMySql )
func (ServiceType) String ¶
func (p ServiceType) String() string
Click to show internal directories.
Click to hide internal directories.