client

package
v0.0.0-...-e66000f Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnableIptablesForward

func EnableIptablesForward() error

Types

type FireInfo

type FireInfo struct {
	ID       uint   `json:"id"`
	Chain    string `json:"chain"`
	Family   string `json:"family"`  // ipv4 ipv6
	Address  string `json:"address"` // Anywhere
	Port     string `json:"port"`
	Protocol string `json:"protocol"` // tcp udp tcp/udp
	Strategy string `json:"strategy"` // accept drop

	Num        string `json:"num"`
	TargetIP   string `json:"targetIP"`
	TargetPort string `json:"targetPort"`
	Interface  string `json:"interface"`

	UsedStatus  string `json:"usedStatus"`
	Description string `json:"description"`
}

type Firewall

type Firewall struct{}

func NewFirewalld

func NewFirewalld() (*Firewall, error)

func (*Firewall) EnableForward

func (f *Firewall) EnableForward() error

func (*Firewall) ListAddress

func (f *Firewall) ListAddress() ([]FireInfo, error)

func (*Firewall) ListForward

func (f *Firewall) ListForward() ([]FireInfo, error)

func (*Firewall) ListPort

func (f *Firewall) ListPort() ([]FireInfo, error)

func (*Firewall) Name

func (f *Firewall) Name() string

func (*Firewall) Port

func (f *Firewall) Port(port FireInfo, operation string) error

func (*Firewall) PortForward

func (f *Firewall) PortForward(info Forward, operation string) error

func (*Firewall) Reload

func (f *Firewall) Reload() error

func (*Firewall) Restart

func (f *Firewall) Restart() error

func (*Firewall) RichRules

func (f *Firewall) RichRules(rule FireInfo, operation string) error

func (*Firewall) Start

func (f *Firewall) Start() error

func (*Firewall) Status

func (f *Firewall) Status() (bool, error)

func (*Firewall) Stop

func (f *Firewall) Stop() error

func (*Firewall) Version

func (f *Firewall) Version() (string, error)

type Forward

type Forward struct {
	Num        string `json:"num"`
	Protocol   string `json:"protocol"`
	Port       string `json:"port"`
	TargetIP   string `json:"targetIP"`
	TargetPort string `json:"targetPort"`
	Interface  string `json:"interface"`
}

type Iptables

type Iptables struct{}

func NewIptables

func NewIptables() (*Iptables, error)

func (*Iptables) EnableForward

func (i *Iptables) EnableForward() error

func (*Iptables) ListAddress

func (i *Iptables) ListAddress() ([]FireInfo, error)

func (*Iptables) ListForward

func (i *Iptables) ListForward() ([]FireInfo, error)

func (*Iptables) ListPort

func (i *Iptables) ListPort() ([]FireInfo, error)

func (*Iptables) Name

func (i *Iptables) Name() string

func (*Iptables) Port

func (i *Iptables) Port(port FireInfo, operation string) error

func (*Iptables) PortForward

func (i *Iptables) PortForward(info Forward, operation string) error

func (*Iptables) Reload

func (i *Iptables) Reload() error

func (*Iptables) Restart

func (i *Iptables) Restart() error

func (*Iptables) RichRules

func (i *Iptables) RichRules(rule FireInfo, operation string) error

func (*Iptables) Start

func (i *Iptables) Start() error

func (*Iptables) Status

func (i *Iptables) Status() (bool, error)

func (*Iptables) Stop

func (i *Iptables) Stop() error

func (*Iptables) Version

func (i *Iptables) Version() (string, error)

type Ufw

type Ufw struct {
	CmdStr string
}

func NewUfw

func NewUfw() (*Ufw, error)

func (*Ufw) EnableForward

func (f *Ufw) EnableForward() error

func (*Ufw) ListAddress

func (f *Ufw) ListAddress() ([]FireInfo, error)

func (*Ufw) ListForward

func (f *Ufw) ListForward() ([]FireInfo, error)

func (*Ufw) ListPort

func (f *Ufw) ListPort() ([]FireInfo, error)

func (*Ufw) Name

func (f *Ufw) Name() string

func (*Ufw) Port

func (f *Ufw) Port(port FireInfo, operation string) error

func (*Ufw) PortForward

func (f *Ufw) PortForward(info Forward, operation string) error

func (*Ufw) Reload

func (f *Ufw) Reload() error

func (*Ufw) Restart

func (f *Ufw) Restart() error

func (*Ufw) RichRules

func (f *Ufw) RichRules(rule FireInfo, operation string) error

func (*Ufw) Start

func (f *Ufw) Start() error

func (*Ufw) Status

func (f *Ufw) Status() (bool, error)

func (*Ufw) Stop

func (f *Ufw) Stop() error

func (*Ufw) Version

func (f *Ufw) Version() (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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