Allow configurable addresses for everything

This commit is contained in:
Asim
2015-05-16 00:34:02 +01:00
parent c77be7c571
commit 0e7bd77f4c
13 changed files with 143 additions and 41 deletions

View File

@@ -138,9 +138,12 @@ func (c *ConsulRegistry) Watch() {
NewConsulWatcher(c)
}
func NewConsulRegistry() Registry {
func NewConsulRegistry(addrs []string, opts ...Options) Registry {
config := consul.DefaultConfig()
client, _ := consul.NewClient(config)
if len(addrs) > 0 {
config.Address = addrs[0]
}
cr := &ConsulRegistry{
Address: config.Address,