Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrDiscoveryDown = errors.New("discovery down")
)
Functions ¶
Types ¶
type IApp ¶
type IApp interface {
IAttributes
ID() string
Nodes() []INode
Reset(nodes Nodes)
NodeError(id string) error
Close() error
}
IApp app接口
func NewApp ¶
func NewApp(checker IHealthChecker, container IAppContainer, attrs Attrs, nodes Nodes) IApp
NewApp 创建服务发现app
type IAttributes ¶
IAttributes 属性接口
type IDiscovery ¶
IDiscovery 服务发现接口
type IHealthChecker ¶
IHealthChecker 健康检查接口
type IHealthCheckerFactory ¶
type IHealthCheckerFactory interface {
IHealthChecker
Agent() (IHealthChecker, error)
Reset(conf interface{}) error
}
IHealthCheckerFactory 健康检查工厂类接口
type INode ¶
type INode interface {
IAttributes
ID() string
IP() string
Port() int
Scheme() string
Addr() string
Status() NodeStatus
Up()
Down()
Leave()
}
INode 节点接口
type INodesData ¶
type IServices ¶
type IServices interface {
Set(serviceName string, id string, app IApp) error
Remove(id string) (string, int)
Update(serviceName string, nodes Nodes) error
AppKeys() []string
}
IServices 服务app集合接口
type NodeStatus ¶
type NodeStatus int
NodeStatus 节点状态类型
const ( //Running 节点运行中状态 Running NodeStatus = 1 //Down 节点不可用状态 Down NodeStatus = 2 //Leave 节点离开状态 Leave NodeStatus = 3 )
type NodesData ¶
type NodesData struct {
// contains filtered or unexported fields
}
func NewNodesData ¶
func NewNodesData() *NodesData
Click to show internal directories.
Click to hide internal directories.