Add endpoints in etcd
This commit is contained in:
parent
763608854b
commit
6ab6e9725d
@ -66,8 +66,10 @@ func (e *etcdRegistry) Register(s *registry.Service) error {
|
||||
}
|
||||
|
||||
service := ®istry.Service{
|
||||
Name: s.Name,
|
||||
Metadata: s.Metadata,
|
||||
Name: s.Name,
|
||||
Version: s.Version,
|
||||
Metadata: s.Metadata,
|
||||
Endpoints: s.Endpoints,
|
||||
}
|
||||
|
||||
e.client.Set(context.Background(), servicePath(s.Name), "", &etcd.SetOptions{Dir: true})
|
||||
@ -105,7 +107,9 @@ func (e *etcdRegistry) GetService(name string) (*registry.Service, error) {
|
||||
}
|
||||
sn := decode(n.Value)
|
||||
s.Name = sn.Name
|
||||
s.Version = sn.Version
|
||||
s.Metadata = sn.Metadata
|
||||
s.Endpoints = sn.Endpoints
|
||||
for _, node := range sn.Nodes {
|
||||
s.Nodes = append(s.Nodes, node)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user