| | |
| | | |
| | | type ServiceInfo struct { |
| | | ServiceId string `json:"serviceId"` |
| | | Info interface{} `json:"info"` |
| | | Info []byte `json:"info"` |
| | | } |
| | | |
| | | func Client(urlServer string, serviceId string) (*DiscoveryClient, error) { |
| | |
| | | d.cancel() |
| | | } |
| | | |
| | | func (d *DiscoveryClient) SetResp(i interface{}) { |
| | | func (d *DiscoveryClient) SetResp(i []byte) { |
| | | d.service.Info = i |
| | | } |
| | | |
| | |
| | | // publisher, we are going to publish the changes of the set here |
| | | publisher *Publisher |
| | | |
| | | svInfo map[string]interface{} |
| | | svInfo map[string][]byte |
| | | } |
| | | |
| | | type Publisher struct { |
| | |
| | | } |
| | | |
| | | responses = NewStringSet() |
| | | d.services.svInfo = make(map[string]interface{}, 0) |
| | | d.services.svInfo = make(map[string][]byte, 0) |
| | | for { |
| | | msg, err = d.sock.Recv() |
| | | if err != nil { |
| | |
| | | s := &Services{ |
| | | nodes: NewStringSet(), |
| | | publisher: publisher, |
| | | svInfo: make(map[string]interface{}, 0), |
| | | svInfo: make(map[string][]byte, 0), |
| | | } |
| | | |
| | | return s |
| | |
| | | return d.services.nodes |
| | | } |
| | | |
| | | func (d *DiscoveryServer) SvInfo() map[string]interface{} { |
| | | m := make(map[string]interface{}) |
| | | func (d *DiscoveryServer) SvInfo() map[string][]byte { |
| | | m := make(map[string][]byte) |
| | | for k,v := range d.services.svInfo { |
| | | m[k] = v |
| | | } |