Esempio n. 1
0
func (this *Registry) get() *common.RegistrySync {
	this.mutex.Lock()
	defer this.mutex.Unlock()
	serviceRegister := make(map[string][]string)
	for k, v := range this.register {
		endpoints := make([]string, len(v))
		for i, item := range v {
			endpoints[i] = item.serviceUrl
		}
		serviceRegister[k] = endpoints
	}
	return common.NewRegistrySync(serviceRegister)
}
Esempio n. 2
0
func NewClient(name, url string) *Client {
	return &Client{name, url, nil, false, common.NewRegistrySync(nil)}
}