Help us shape the future of Go! Take the 2026 Go Developer Survey

goshorewall

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2025 License: AGPL-3.0 Imports: 7 Imported by: 0

README

go-shorewall

A Go library for managing the Shorewall firewall.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInterfaceAlreadyExists = errors.New("interface already exists")
	ErrInterfaceNotFound      = errors.New("interface not found")
)
View Source
var (
	ErrPolicyAlreadyExists = errors.New("policy already exists")
	ErrPolicyNotFound      = errors.New("policy not found")
)
View Source
var (
	ErrRuleAlreadyExists = errors.New("rule already exists")
	ErrRuleNotFound      = errors.New("rule not found")
)
View Source
var (
	ErrSnatAlreadyExists = errors.New("snat rule already exists")
	ErrSnatNotFound      = errors.New("snat rule not found")
)
View Source
var (
	ErrZoneAlreadyExists = errors.New("zone already exists")
	ErrZoneNotFound      = errors.New("zone not found")
)

Functions

func AddInterface

func AddInterface(iface Interface) error

func AddPolicy

func AddPolicy(policy Policy) error

func AddRule

func AddRule(rule Rule) error

func AddSnat

func AddSnat(snat Snat) error

func AddZone

func AddZone(zone Zone) error

func GetVersion

func GetVersion() (string, error)

func Reload added in v0.0.2

func Reload() error

func RemoveInterfaceByZone

func RemoveInterfaceByZone(zone string) error

func RemovePolicy

func RemovePolicy(policy Policy) error

func RemoveRule

func RemoveRule(rule Rule) error

func RemoveSnat

func RemoveSnat(snat Snat) error

func RemoveZone

func RemoveZone(zoneName string) error

Types

type Interface

type Interface struct {
	Zone string
	Name string
}

func GetInterfaces

func GetInterfaces() ([]Interface, error)

type Policy

type Policy struct {
	Source      string
	Destination string
	Policy      string
	Log         string
}

func GetPolicies

func GetPolicies() ([]Policy, error)

type Rule

type Rule struct {
	Action      string
	Source      string
	Destination string
	Protocol    string
	Dport       string
	Sport       string
}

func GetRules

func GetRules() ([]Rule, error)

type Snat

type Snat struct {
	Action      string
	Source      string
	Destination string
}

func GetSnats

func GetSnats() ([]Snat, error)

type Zone

type Zone struct {
	Name string
	Type string
}

func GetZones

func GetZones() ([]Zone, error)

Jump to

Keyboard shortcuts

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