Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrPlatformUnsupported = PlatformUnsupportedError{}
Functions ¶
This section is empty.
Types ¶
type PlatformUnsupportedError ¶
type PlatformUnsupportedError struct{}
PlatformUnsupportedError is returned when the platform is not supported by netlink.
func (PlatformUnsupportedError) Error ¶
func (PlatformUnsupportedError) Error() string
func (PlatformUnsupportedError) Is ¶
func (PlatformUnsupportedError) Is(target error) bool
type Producer ¶
type Producer struct {
// contains filtered or unexported fields
}
Producer monitors the IP addresses of a network interface using Linux's netlink interface, and broadcasts IP address change notifications to subscribers.
Producer implements producerpkg.Producer.
func (*Producer) Run ¶
Run initiates the monitoring process for IP address changes.
Run implements producerpkg.Producer.Run.
func (*Producer) Subscribe ¶
func (p *Producer) Subscribe() <-chan producerpkg.Message
Subscribe returns a channel for receiving updates on IP address changes.
Subscribe implements producerpkg.Producer.Subscribe.
type ProducerConfig ¶
type ProducerConfig struct { // Interface is the name of the network interface to monitor. Interface string `json:"interface"` // FromAddrLookupMain controls whether to add policy routing rules to let // packets originating from the interface addresses use the main routing table. // // This option is useful when a VPN connection is the default route, and the // physical interface still needs to handle incoming connections. FromAddrLookupMain bool `json:"from_addr_lookup_main"` }
ProducerConfig contains configuration options for the netlink producer.
func (*ProducerConfig) NewProducer ¶
func (cfg *ProducerConfig) NewProducer(logger *tslog.Logger) (*Producer, error)
NewProducer creates a new producer that monitors the IP addresses of a network interface.