1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/libnetwork/hostdiscovery/hostdiscovery_api.go
Madhu Venugopal 5fff515028 Including hostdiscovery conditionaly under a build tag
In order to vendor-in libnetwork to docker, we need to remove the swarm
dependency even though it is used as library. using this PR, a new build
flag libnetwork_discovery is introduced in order to avoid pulling in the
unused hostdiscovery functionality into docker.
We are working with the Swarm project to see if we can modularize the
discovery package to become independent so that we can include them as a
vendor-in package in docker.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-04 05:00:09 -07:00

23 lines
703 B
Go

package hostdiscovery
import (
"net"
"github.com/docker/libnetwork/config"
)
// JoinCallback provides a callback event for new node joining the cluster
type JoinCallback func(entries []net.IP)
// LeaveCallback provides a callback event for node leaving the cluster
type LeaveCallback func(entries []net.IP)
// HostDiscovery primary interface
type HostDiscovery interface {
// StartDiscovery initiates the discovery process and provides appropriate callbacks
StartDiscovery(*config.ClusterCfg, JoinCallback, LeaveCallback) error
// StopDiscovery stops the discovery perocess
StopDiscovery() error
// Fetch returns a list of host IPs that are currently discovered
Fetch() ([]net.IP, error)
}