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 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 WithNetns ¶
type WithNetns struct { WatcherOption Netns string }
WithNetns select net NS(by name) for watching
Click to show internal directories.
Click to hide internal directories.