discoverymanager

package
v0.35.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2024 License: GPL-3.0 Imports: 7 Imported by: 1

Documentation

Index

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 New

func New() *DiscoveryManager

New creates a new DiscoveryManager

func (*DiscoveryManager) Add

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) Close

func (pw *PortWatcher) Close()

Close closes the PortWatcher

func (*PortWatcher) Feed

func (pw *PortWatcher) Feed() <-chan *discovery.Event

Feed returns the feed of events coming from the discoveries

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL