registry: fix them all for go-micro master (#533)

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2020-04-16 02:03:07 +03:00
parent bde39583ab
commit 283d87772a
3 changed files with 6 additions and 4 deletions

2
go.mod
View File

@ -9,7 +9,7 @@ require (
github.com/google/uuid v1.1.1 github.com/google/uuid v1.1.1
github.com/hashicorp/memberlist v0.1.5 github.com/hashicorp/memberlist v0.1.5
github.com/leodido/go-urn v1.2.0 // indirect github.com/leodido/go-urn v1.2.0 // indirect
github.com/micro/go-micro/v2 v2.4.1-0.20200411193729-3ce2ab88f553 github.com/micro/go-micro/v2 v2.4.1-0.20200415145051-62cedf64daaf
github.com/micro/mdns v0.3.0 // indirect github.com/micro/mdns v0.3.0 // indirect
github.com/mitchellh/hashstructure v1.0.0 github.com/mitchellh/hashstructure v1.0.0
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect

2
go.sum
View File

@ -290,6 +290,8 @@ github.com/micro/go-micro/v2 v2.3.0 h1:3seJJ7/pbhleZNe6gGHFJjOsAqvYGcy2ivc3P5PYn
github.com/micro/go-micro/v2 v2.3.0/go.mod h1:GR69d1AXMg/WjMNf/7K1VO6hCBJDIpqCqnVYNTV6M5w= github.com/micro/go-micro/v2 v2.3.0/go.mod h1:GR69d1AXMg/WjMNf/7K1VO6hCBJDIpqCqnVYNTV6M5w=
github.com/micro/go-micro/v2 v2.4.1-0.20200411193729-3ce2ab88f553 h1:lvLhe6eD+e5B79VoFTcIoOXUfiPp+Uf29C5PyntliSM= github.com/micro/go-micro/v2 v2.4.1-0.20200411193729-3ce2ab88f553 h1:lvLhe6eD+e5B79VoFTcIoOXUfiPp+Uf29C5PyntliSM=
github.com/micro/go-micro/v2 v2.4.1-0.20200411193729-3ce2ab88f553/go.mod h1:E9E3RGlgxMl5yv7/IITu5jHAxWveL8rLR9kim8EzDJI= github.com/micro/go-micro/v2 v2.4.1-0.20200411193729-3ce2ab88f553/go.mod h1:E9E3RGlgxMl5yv7/IITu5jHAxWveL8rLR9kim8EzDJI=
github.com/micro/go-micro/v2 v2.4.1-0.20200415145051-62cedf64daaf h1:2DqADUkjUSpYOabHX/XD606xPQcLTbWRzFygxm+q6UQ=
github.com/micro/go-micro/v2 v2.4.1-0.20200415145051-62cedf64daaf/go.mod h1:qz2UT4UFdFVs+qUGMuDK3xuHgude1BgntqQ29sbpPlE=
github.com/micro/mdns v0.3.0 h1:bYycYe+98AXR3s8Nq5qvt6C573uFTDPIYzJemWON0QE= github.com/micro/mdns v0.3.0 h1:bYycYe+98AXR3s8Nq5qvt6C573uFTDPIYzJemWON0QE=
github.com/micro/mdns v0.3.0/go.mod h1:KJ0dW7KmicXU2BV++qkLlmHYcVv7/hHnbtguSWt9Aoc= github.com/micro/mdns v0.3.0/go.mod h1:KJ0dW7KmicXU2BV++qkLlmHYcVv7/hHnbtguSWt9Aoc=
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=

View File

@ -754,7 +754,7 @@ func (g *gossipRegistry) Register(s *registry.Service, opts ...registry.Register
return nil return nil
} }
func (g *gossipRegistry) Deregister(s *registry.Service) error { func (g *gossipRegistry) Deregister(s *registry.Service, opts ...registry.DeregisterOption) error {
log.Debugf("[gossip] Registry deregistering service: %s", s.Name) log.Debugf("[gossip] Registry deregistering service: %s", s.Name)
@ -799,7 +799,7 @@ func (g *gossipRegistry) Deregister(s *registry.Service) error {
return nil return nil
} }
func (g *gossipRegistry) GetService(name string) ([]*registry.Service, error) { func (g *gossipRegistry) GetService(name string, opts ...registry.GetOption) ([]*registry.Service, error) {
g.RLock() g.RLock()
service, ok := g.services[name] service, ok := g.services[name]
g.RUnlock() g.RUnlock()
@ -809,7 +809,7 @@ func (g *gossipRegistry) GetService(name string) ([]*registry.Service, error) {
return service, nil return service, nil
} }
func (g *gossipRegistry) ListServices() ([]*registry.Service, error) { func (g *gossipRegistry) ListServices(opts ...registry.ListOption) ([]*registry.Service, error) {
g.RLock() g.RLock()
services := make([]*registry.Service, 0, len(g.services)) services := make([]*registry.Service, 0, len(g.services))
for _, service := range g.services { for _, service := range g.services {