Add Init to all things, use init in cmd package to initialise

This commit is contained in:
Asim Aslam
2018-08-08 18:57:29 +01:00
parent 68f5e71153
commit 9968c7d007
8 changed files with 118 additions and 76 deletions

View File

@@ -99,11 +99,15 @@ func (m *mockRegistry) String() string {
return "mock"
}
func (m *mockRegistry) Init(opts ...registry.Option) error {
return nil
}
func (m *mockRegistry) Options() registry.Options {
return registry.Options{}
}
func NewRegistry() registry.Registry {
func NewRegistry(opts ...registry.Options) registry.Registry {
m := &mockRegistry{Services: make(map[string][]*registry.Service)}
m.init()
return m