forwarding

package
v0.0.0-...-3c0bd05 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FamilyIPv4 = constant.FirewallFamilyIPv4
	FamilyIPv6 = constant.FirewallFamilyIPv6

	ChainPreRouting  = "1PANEL_PREROUTING"
	ChainPostRouting = "1PANEL_POSTROUTING"
	ChainForward     = "1PANEL_FORWARD"

	ForwardFile     = "1panel_forward.rules"
	PreRoutingFile  = "1panel_forward_pre.rules"
	PostRoutingFile = "1panel_forward_post.rules"
)

Variables

View Source
var ErrRuleExists = errors.New("forwarding rule already exists")

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	Name() string
	List() ([]Rule, error)
	Reconcile(rules []Rule) error
	Enable() error
	Cleanup() error
	InitStatus() (bool, bool, error)
	FamilyStatus(family string) (bool, bool, error)
	Replay() error
}

type Manager

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

func NewManager

func NewManager(adapter Adapter, runtime RuntimeClient) *Manager

func (*Manager) Cleanup

func (m *Manager) Cleanup() error

func (*Manager) Enable

func (m *Manager) Enable() error

func (*Manager) FamilyStatus

func (m *Manager) FamilyStatus(family string) (bool, bool, error)

func (*Manager) List

func (m *Manager) List(info, strategy string) ([]Rule, error)

func (*Manager) Name

func (m *Manager) Name() string

func (*Manager) Reconcile

func (m *Manager) Reconcile(rules []Rule) error

func (*Manager) Replay

func (m *Manager) Replay() error

func (*Manager) Status

func (m *Manager) Status() (Status, error)

type OperationType

type OperationType string
const (
	OperationAdd    OperationType = "add"
	OperationRemove OperationType = "remove"
)

type Rule

type Rule struct {
	Num        string
	Family     string
	Protocol   string
	Port       string
	TargetIP   string
	TargetPort string
	Interface  string
}

func NormalizeRule

func NormalizeRule(rule Rule) (Rule, error)

func (Rule) Identity

func (r Rule) Identity() string

type RuntimeClient

type RuntimeClient interface {
	Version() (string, error)
}

type Status

type Status struct {
	Name    string
	Version string
	IsInit  bool
	IsBind  bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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