rule

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	// Add adds a new rule.
	//
	// This command is equivalent to:
	// 		nft add rule (ip|ip6|inet|arp|bridge) {table_name} {chain_name} '{ expr }'
	Add(family family.Type, tableName string, chainName string, expr ...string) error

	// Insert inserts a new rule.
	// Inserted rules are placed at the beginning of the chain, by default.
	//
	// This command is equivalent to:
	// 		nft insert rule (ip|ip6|inet|arp|bridge) {table_name} {chain_name} '{ expr }'
	Insert(family family.Type, tableName string, chainName string, expr ...string) error

	// Replace replaces a rule.
	//
	// This command is equivalent to:
	// 		nft replace rule (ip|ip6|inet|arp|bridge) {table_name} {chain_name} {handle} '{ expr }'
	Replace(family family.Type, tableName string, chainName string, handle uint64, expr ...string) error

	// Delete deletes a rule.
	//
	// This command is equivalent to:
	// 		nft delete rule (ip|ip6|inet|arp|bridge) {table_name} {chain_name} {handle}
	Delete(family family.Type, tableName string, chainName string, handle uint64) error
}

func New

func New(command command.NFT) API

Jump to

Keyboard shortcuts

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