Added Options() to registry interface

This commit is contained in:
darren-west
2017-09-28 11:16:56 +01:00
parent d29b5e2fab
commit d970586a29
4 changed files with 15 additions and 2 deletions

View File

@@ -17,7 +17,7 @@ import (
type consulRegistry struct {
Address string
Client *consul.Client
Options Options
opts Options
sync.Mutex
register map[string]uint64
@@ -93,7 +93,7 @@ func newConsulRegistry(opts ...Option) Registry {
cr := &consulRegistry{
Address: config.Address,
Client: client,
Options: options,
opts: options,
register: make(map[string]uint64),
}
@@ -285,3 +285,7 @@ func (c *consulRegistry) Watch() (Watcher, error) {
func (c *consulRegistry) String() string {
return "consul"
}
func (c *consulRegistry) Options() Options {
return c.opts
}