firewall

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FirewallConfig

type FirewallConfig struct {
	Backend       string
	DefaultPolicy string
}

type FirewallPlugin

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

func New

func New() *FirewallPlugin

func (*FirewallPlugin) AddRule

func (p *FirewallPlugin) AddRule(rule *FirewallRule) error

AddRule adds a firewall rule

func (*FirewallPlugin) AllowPort

func (p *FirewallPlugin) AllowPort(port int, proto string) error

AllowPort is a convenience method to allow a port

func (*FirewallPlugin) Capabilities

func (p *FirewallPlugin) Capabilities() []plugin.Capability

func (*FirewallPlugin) DeleteRule

func (p *FirewallPlugin) DeleteRule(ruleNumber int) error

DeleteRule deletes a firewall rule

func (*FirewallPlugin) DenyPort

func (p *FirewallPlugin) DenyPort(port int, proto string) error

DenyPort is a convenience method to deny a port

func (*FirewallPlugin) Disable

func (p *FirewallPlugin) Disable() error

Disable disables the firewall

func (*FirewallPlugin) Enable

func (p *FirewallPlugin) Enable() error

Enable enables the firewall

func (*FirewallPlugin) Init

func (p *FirewallPlugin) Init(ctx context.Context, config map[string]interface{}) error

func (*FirewallPlugin) ListRules

func (p *FirewallPlugin) ListRules() ([]string, error)

ListRules lists all firewall rules

func (*FirewallPlugin) Name

func (p *FirewallPlugin) Name() string

func (*FirewallPlugin) Shutdown

func (p *FirewallPlugin) Shutdown(ctx context.Context) error

func (*FirewallPlugin) Version

func (p *FirewallPlugin) Version() string

type FirewallRule

type FirewallRule struct {
	Action   string // allow, deny, reject
	Proto    string // tcp, udp, any
	FromIP   string
	FromPort int
	ToIP     string
	ToPort   int
	Comment  string
}

Jump to

Keyboard shortcuts

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