Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Informer ¶
type Informer interface { // Subscribe returns a channel that sends Event instances. Subscribe(ctx context.Context) (<-chan Event, error) }
Informer provides notifications about each network interface that is added or removed from the host. Production implementations: Poller and Watcher.
type Poller ¶
type Poller struct {
// contains filtered or unexported fields
}
Poller periodically looks for the network interfaces in the system and forwards Event notifications when interfaces are added or deleted.
type Registerer ¶
type Registerer struct {
// contains filtered or unexported fields
}
Registerer is an informer that wraps another informer implementation, and keeps track of the currently existing interfaces in the system, accessible through the IfaceNameForIndex method.
func NewRegisterer ¶
func NewRegisterer(inner Informer, bufLen int) *Registerer
func (*Registerer) IfaceNameForIndex ¶
func (r *Registerer) IfaceNameForIndex(idx int) (string, bool)
IfaceNameForIndex gets the interface name given an index as recorded by the underlying interfaces' informer. It backs up into the net.InterfaceByIndex function if the interface has not been previously registered