iprouter

package
v0.0.0-...-851e5e8 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package iprouter provides Go API for interacting with ip route.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Router

type Router struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Router uses `ip route` under the hood.

func (*Router) Add

func (r *Router) Add(route routes.Route) error

Add calls ip route add command and appends route to a routes list if it does not exist yet

func (*Router) Flush

func (r *Router) Flush() error

Flush calls ip route delete command for all existing routes

Jump to

Keyboard shortcuts

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