From 5b1127bcebbf69f255589d59a4be9ec17cf9379a Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Mon, 19 Feb 2018 20:53:51 +0000 Subject: [PATCH] add options method --- gossip.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gossip.go b/gossip.go index 2350f37..358468c 100644 --- a/gossip.go +++ b/gossip.go @@ -37,6 +37,7 @@ type delegate struct { type gossipRegistry struct { broadcasts *memberlist.TransmitLimitedQueue updates chan *update + options registry.Options sync.RWMutex services map[string][]*registry.Service @@ -341,6 +342,10 @@ func (m *gossipRegistry) run() { } } +func (m *gossipRegistry) Options() registry.Options { + return m.options +} + func (m *gossipRegistry) Register(s *registry.Service, opts ...registry.RegisterOption) error { m.Lock() if service, ok := m.services[s.Name]; !ok { @@ -451,6 +456,7 @@ func NewRegistry(opts ...registry.Option) registry.Registry { } mr := &gossipRegistry{ + options: options, broadcasts: broadcasts, services: make(map[string][]*registry.Service), updates: updates,