Fix some issues with initialisation

This commit is contained in:
Asim
2016-01-04 23:07:56 +00:00
parent 9ecbf0d71b
commit 897115ed31
7 changed files with 61 additions and 0 deletions

View File

@@ -28,6 +28,17 @@ func init() {
rand.Seed(time.Now().Unix())
}
func (n *dcSelector) Init(opts ...selector.Option) error {
for _, o := range opts {
o(&n.opts)
}
return nil
}
func (n *dcSelector) Options() selector.Options {
return n.opts
}
func (n *dcSelector) Select(service string, opts ...selector.SelectOption) (selector.Next, error) {
services, err := n.opts.Registry.GetService(service)
if err != nil {