Documentation ¶
Index ¶
Constants ¶
View Source
const ( //IgnoreLinks does not send 'Links' IgnoreLinks scopeOfUpdates //IgnoreAddress does not send 'Adresses' IgnoreAddress )
Variables ¶
View Source
var ( // ErrUnexpectedlyStopped it setds when 'netlink' unextectedly fails ErrUnexpectedlyStopped = errors.New("net-watcher is stopped unexpectedly") // ErrUnsupportedOption used unsupported option ErrUnsupportedOption = errors.New("net-watcher unsupported option") )
Functions ¶
This section is empty.
Types ¶
type AddrUpdateMsg ¶
AddrUpdateMsg address update message
func (AddrUpdateMsg) MarshalJSON ¶
func (m AddrUpdateMsg) MarshalJSON() ([]byte, error)
MarshalJSON impl 'json.Marshaler'
type LinkLister ¶ added in v1.12.0
type LinkLister interface { List(context.Context) ([]Link, error) Addrs(context.Context, Link) ([]Addr, error) Close() error }
LinkLister -
func NewLinkLister ¶ added in v1.12.0
func NewLinkLister(ctx context.Context, opts ...linkListerOpt) (LinkLister, error)
NewLinkLister -
type LinkUpdateMsg ¶
LinkUpdateMsg network link update message
func (LinkUpdateMsg) MarshalJSON ¶
func (m LinkUpdateMsg) MarshalJSON() ([]byte, error)
MarshalJSON impl 'json.Marshaler'
type NetlinkWatcher ¶
type NetlinkWatcher interface { Stream() <-chan []WatcherMsg Close() error }
NetlinkWatcher netlink watch streamer
func NewNetlinkWatcher ¶
func NewNetlinkWatcher(opts ...WatcherOption) (NetlinkWatcher, error)
NewNetlinkWatcher creates NetlinkWatcher instance
type WatcherMsg ¶
type WatcherMsg interface {
// contains filtered or unexported methods
}
WatcherMsg abstract message def
type WatcherOption ¶
type WatcherOption interface {
// contains filtered or unexported methods
}
WatcherOption ...
type WithLinger ¶
type WithLinger struct { WatcherOption Linger time.Duration }
WithLinger - every packet accumulates updates during some duration then it sends to consumer
type WithNetnsName ¶ added in v1.12.0
type WithNetnsName struct { WatcherOption Netns string // contains filtered or unexported fields }
WithNetnsName select net NS(by name) for watching
Click to show internal directories.
Click to hide internal directories.