Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorEmptyNameAddress = errors.New("empty name or address")
Functions ¶
Types ¶
type Consul ¶
type Consul struct {
// contains filtered or unexported fields
}
func (*Consul) RegisterClient ¶
RegisterClient 将client注册到服务中心.
func (*Consul) RegisterService ¶
RegisterService 将service注册到服务中心. 此处与RegisterClient代码略微重复,但需要适应接口.
type HeartbeatOptions ¶
type Node ¶
type Node struct {
// Key 键: 服务名.
Key string
// Value 值: 结点ip地址.
Value string
// Blacklist 黑名单.
Blacklist string
// Whitelist 白名单.
Whitelist string
// Weight 权重.
Weight float64
// LastTime 最新更新时间.
LastTime time.Duration
}
Node 服务结点.
type Options ¶
type Options struct {
SelectorName string `yaml:"name"`
Address string `yaml:"address"`
Scheme string `yaml:"scheme"`
EnableHeartbeat bool `yaml:"enable-heartbeat"`
*HeartbeatOptions `yaml:"heartbeat"`
}
Click to show internal directories.
Click to hide internal directories.