hostdiscovery_api.go 703 B

1234567891011121314151617181920212223
  1. package hostdiscovery
  2. import (
  3. "net"
  4. "github.com/docker/libnetwork/config"
  5. )
  6. // JoinCallback provides a callback event for new node joining the cluster
  7. type JoinCallback func(entries []net.IP)
  8. // LeaveCallback provides a callback event for node leaving the cluster
  9. type LeaveCallback func(entries []net.IP)
  10. // HostDiscovery primary interface
  11. type HostDiscovery interface {
  12. // StartDiscovery initiates the discovery process and provides appropriate callbacks
  13. StartDiscovery(*config.ClusterCfg, JoinCallback, LeaveCallback) error
  14. // StopDiscovery stops the discovery perocess
  15. StopDiscovery() error
  16. // Fetch returns a list of host IPs that are currently discovered
  17. Fetch() ([]net.IP, error)
  18. }