iprulemanager

package
v0.0.0-...-bdf4f4e Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func NewController

func NewController(v4, v6 bool) *Controller

NewController creates a new linux IP rule manager

func (*Controller) Add

func (rm *Controller) Add(rule netlink.Rule) error

Add ensures an IP rule is applied even if it is altered by something else, it will be restored

func (*Controller) AddWithMetadata

func (rm *Controller) AddWithMetadata(rule netlink.Rule, metadata string) error

AddWithMetadata ensures an IP rule along with its metadata is applied even if it is altered by something else, it will be restored

func (*Controller) Delete

func (rm *Controller) Delete(rule netlink.Rule) error

Delete stops managed an IP rule and ensures its deleted

func (*Controller) DeleteWithMetadata

func (rm *Controller) DeleteWithMetadata(metadata string) error

Delete stops managing all IP rules with the provided metadata and ensures they are all deleted

func (*Controller) OwnPriority

func (rm *Controller) OwnPriority(priority int) error

OwnPriority ensures any IP rules observed with priority 'priority' must be specified otherwise its removed

func (*Controller) Run

func (rm *Controller) Run(stopCh <-chan struct{}, syncPeriod time.Duration)

Run starts manages linux IP rules

Jump to

Keyboard shortcuts

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