nftman

package
v0.1.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	NftTableName = "cgtproxy"
)

Variables

View Source
var (
	ErrNftableConnMissing = errors.New("`nftables.Conn` is missing.")
	ErrRerouteMarkMissing = errors.New("reroute mark is missing.")
	ErrLoggerMissing      = errors.New("logger is missing.")
	ErrCGroupRootMissing  = errors.New("cgroupv2 file system mount point is missing.")
	ErrConnFactoryMissing = errors.New("netlink conn factory is missing.")
)

Functions

This section is empty.

Types

type NFTManager

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

func New

func New(opts ...Opt) (ret *NFTManager, err error)

func (*NFTManager) AddChainAndRulesForTProxies added in v0.1.4

func (nft *NFTManager) AddChainAndRulesForTProxies(tps []*config.TProxy) (err error)

func (*NFTManager) AddRoutes

func (nft *NFTManager) AddRoutes(routes []types.Route) (err error)

func (*NFTManager) Clear

func (nft *NFTManager) Clear() (err error)

func (*NFTManager) Release

func (nft *NFTManager) Release() (err error)

func (*NFTManager) RemoveRoutes added in v0.1.4

func (nft *NFTManager) RemoveRoutes(paths []string) (err error)

type Opt

type Opt = (func(*NFTManager) (*NFTManager, error))

func WithBypass

func WithBypass(bypass config.Bypass) Opt

func WithCgroupRoot

func WithCgroupRoot(root config.CGroupRoot) Opt

func WithConnFactory

func WithConnFactory(f interfaces.NetlinkConnector) Opt

func WithLogger

func WithLogger(log *zap.SugaredLogger) Opt

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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