Documentation
¶
Index ¶
- Variables
- type Config
- type Firewall
- func (fw *Firewall) Add(accept bool, networks []string) error
- func (fw *Firewall) Create() error
- func (fw *Firewall) Destroy() error
- func (fw *Firewall) List(accept bool) ([]string, error)
- func (fw *Firewall) ModifyIP(accept, add bool, networks []string) error
- func (fw *Firewall) Remove(accept bool, networks []string) error
- type NFTables
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotImplemented = errors.New("not implemented")
ErrNotImplemented возвращается при попытке инициализировать нереализованный фаервол.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
FW string `choice:"nft" choice:"ipset" default:"nft" description:"Firewall type" env:"FW" long:"fw"`
config.Config
}
Config содержит тип и стандартные настройки фаервола.
type Firewall ¶
type Firewall struct {
// contains filtered or unexported fields
}
Firewall содержит методы, которые проксируются в фаервол.
type NFTables ¶
type NFTables interface {
Create(accept bool) error
ModifyIP(accept, add bool, networks []string) error
Add(accept bool, networks []string) error
Remove(accept bool, networks []string) error
List(accept bool) ([]string, error)
Destroy() error
}
NFTables описывает общий для фаерволов интерфейс.
Click to show internal directories.
Click to hide internal directories.