From 8f78a764c10e1012fec443c9021c73b32485bbb9 Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Fri, 21 Aug 2020 09:23:01 +0100 Subject: [PATCH] Registry router fixes (#1961) * only cache routes if told to do so * Use roundrobin selector and retry in proxy * Update lookup to require service * Fix compile * Fix compile * Update * Update * rename query to lookup * Update router.go * Update --- mdns.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mdns.go b/mdns.go index c5812a2..ce11fd1 100644 --- a/mdns.go +++ b/mdns.go @@ -42,19 +42,19 @@ func (m *mdnsRouter) Table() router.Table { return nil } -func (m *mdnsRouter) Lookup(opts ...router.QueryOption) ([]router.Route, error) { - options := router.NewQuery(opts...) +func (m *mdnsRouter) Lookup(service string, opts ...router.LookupOption) ([]router.Route, error) { + options := router.NewLookup(opts...) // check to see if we have the port provided in the service, e.g. go-micro-srv-foo:8000 - service, port, err := net.SplitHostPort(options.Service) + srv, port, err := net.SplitHostPort(service) if err != nil { - service = options.Service + srv = service } // query for the host entries := make(chan *mdns.ServiceEntry) - p := mdns.DefaultParams(service) + p := mdns.DefaultParams(srv) p.Timeout = time.Millisecond * 100 p.Entries = entries