Documentation ¶
Index ¶
- type DiscoveryManager
- func (dm *DiscoveryManager) Add(d *discovery.PluggableDiscovery) error
- func (dm *DiscoveryManager) AddAllDiscoveriesFrom(src *DiscoveryManager)
- func (dm *DiscoveryManager) Clear()
- func (dm *DiscoveryManager) IDs() []string
- func (dm *DiscoveryManager) List() []*discovery.Port
- func (dm *DiscoveryManager) Start() []error
- func (dm *DiscoveryManager) Watch() (*PortWatcher, error)
- type PortWatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiscoveryManager ¶
type DiscoveryManager struct {
// contains filtered or unexported fields
}
DiscoveryManager manages the many-to-many communication between all pluggable discoveries and all watchers. Each PluggableDiscovery, once started, will produce a sequence of "events". These events will be broadcasted to all listening Watcher. The DiscoveryManager will not start the discoveries until the Start method is called.
func (*DiscoveryManager) Add ¶
func (dm *DiscoveryManager) Add(d *discovery.PluggableDiscovery) error
Add adds a discovery to the list of managed discoveries
func (*DiscoveryManager) AddAllDiscoveriesFrom ¶
func (dm *DiscoveryManager) AddAllDiscoveriesFrom(src *DiscoveryManager)
AddAllDiscoveriesFrom transfers discoveries from src to the receiver
func (*DiscoveryManager) Clear ¶
func (dm *DiscoveryManager) Clear()
Clear resets the DiscoveryManager to its initial state
func (*DiscoveryManager) IDs ¶
func (dm *DiscoveryManager) IDs() []string
IDs returns the list of discoveries' ids in this DiscoveryManager
func (*DiscoveryManager) List ¶
func (dm *DiscoveryManager) List() []*discovery.Port
List return the current list of ports detected from all discoveries
func (*DiscoveryManager) Start ¶
func (dm *DiscoveryManager) Start() []error
Start starts all the discoveries in this DiscoveryManager. If the discoveries are already running, this function does nothing.
func (*DiscoveryManager) Watch ¶
func (dm *DiscoveryManager) Watch() (*PortWatcher, error)
Watch starts a watcher for all discovery events (port connection/disconnection). The watcher must be closed when it is no longer needed with the Close method.
type PortWatcher ¶
type PortWatcher struct {
// contains filtered or unexported fields
}
PortWatcher is a watcher for all discovery events (port connection/disconnection)
func (*PortWatcher) Feed ¶
func (pw *PortWatcher) Feed() <-chan *discovery.Event
Feed returns the feed of events coming from the discoveries