nftman

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 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) AddChainAndRulesForTProxy

func (nft *NFTManager) AddChainAndRulesForTProxy(tp *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) RemoveCgroups

func (nft *NFTManager) RemoveCgroups(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