Since Swarm discovery is used by libnetwork without the swarm main(), it
is forced to use annonymous import in order to force-trigger the
unexported init() methods. Using annonymous import is highly discouraged
in a Non-Main and Non-Test packages.
Introducing exported Init() methods on these files so that libnetwork
can use Discovery as a library without having a main package.
Signed-off-by: Madhu Venugopal <madhu@docker.com>
- Watch() issues updates by channel rather than by callback
- Fetch() is gone
- Watch() can be stopped at any time by closing the stop channel
- Watch() is now resilient to errors and will try over and over
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
All of these structs are public. Previously when they were used, they'd
look like the following:
- `consul.ConsulDiscoveryService`
- `etcd.EtcdDiscoveryService`
- `file.FileDiscoveryService`
- `nodes.NodesDiscoveryService`
- `token.TokenDiscoveryService`
- `zookeeper.ZkDiscoveryService`
As a result, they stuttered when read. This commit removes the
duplication of the package names on the struct so that they read better.
See also: https://golang.org/ref/spec#Import_declarations
Signed-off-by: Kushal Pisavadia <kushi.p@gmail.com>
This changeset fixes all lint violations that show up with a
min_confidence of 1
- Issue #500: Run golint on codebase
Signed-off-by: Matt Bajor <matt@notevenremotelydorky.com>