Documentation
¶
Index ¶
Constants ¶
View Source
const (
SERVICE_WEIGHT = 10
)
Variables ¶
View Source
var ( // selector每DefaultTTL分钟通过tick函数清空cache或者get函数去清空某个service的cache, // 以全量获取某个service的所有providers DefaultTTL = 5 * time.Minute )
Functions ¶
func ArrayRemoveAt ¶
func ArrayRemoveAt(a interface{}, i int)
func NewSelector ¶
selector主要有两个接口,对外接口Select用于获取地址,select调用get,get调用cp; 对内接口run调用watch,watch则调用update,update调用set,以用于接收add/del service url.
还有两个接口Init和Close,Init用于发出reload信号,重新初始化selector,而Close则是发出stop信号,停掉watch,清算破产
registor自身主要向selector暴露了watch功能
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.