Documentation
¶
Index ¶
- Variables
- func AddInterface(iface Interface) error
- func AddPolicy(policy Policy) error
- func AddRule(rule Rule) error
- func AddSnat(snat Snat) error
- func AddZone(zone Zone) error
- func Reload() error
- func RemoveInterfaceByZone(zone string) error
- func RemovePolicy(policy Policy) error
- func RemoveRule(rule Rule) error
- func RemoveSnat(snat Snat) error
- func RemoveZone(zoneName string) error
- func Version() (string, error)
- type App
- func (a *App) AddInterface(iface Interface) error
- func (a *App) AddPolicy(policy Policy) error
- func (a *App) AddRule(rule Rule) error
- func (a *App) AddSnat(snat Snat) error
- func (a *App) AddZone(zone Zone) error
- func (a *App) BasePath() string
- func (a *App) ID() string
- func (a *App) InterfaceFilePath() string
- func (a *App) Interfaces() ([]Interface, error)
- func (a *App) Policies() ([]Policy, error)
- func (a *App) PolicyFilePath() string
- func (a *App) Reload() error
- func (a *App) RemoveInterfaceByZone(zone string) error
- func (a *App) RemovePolicy(policy Policy) error
- func (a *App) RemoveRule(rule Rule) error
- func (a *App) RemoveSnat(snat Snat) error
- func (a *App) RemoveZone(zoneName string) error
- func (a *App) Rules() ([]Rule, error)
- func (a *App) RulesFilePath() string
- func (a *App) SnatFilePath() string
- func (a *App) Snats() ([]Snat, error)
- func (a *App) Version() (string, error)
- func (a *App) Zones() ([]Zone, error)
- func (a *App) ZonesFilePath() string
- type Interface
- type Policy
- type Rule
- type Snat
- type Zone
Constants ¶
This section is empty.
Variables ¶
var ( ErrInterfaceAlreadyExists = errors.New("interface already exists") ErrInterfaceNotFound = errors.New("interface not found") )
var ( ErrPolicyAlreadyExists = errors.New("policy already exists") ErrPolicyNotFound = errors.New("policy not found") )
var ( ErrRuleAlreadyExists = errors.New("rule already exists") ErrRuleNotFound = errors.New("rule not found") )
var ( ErrSnatAlreadyExists = errors.New("snat rule already exists") ErrSnatNotFound = errors.New("snat rule not found") )
var ( ErrZoneAlreadyExists = errors.New("zone already exists") ErrZoneNotFound = errors.New("zone not found") )
Functions ¶
func AddInterface ¶
func RemoveInterfaceByZone ¶
func RemovePolicy ¶
func RemoveRule ¶
func RemoveSnat ¶
func RemoveZone ¶
Types ¶
type App ¶ added in v0.0.7
type App struct {
// contains filtered or unexported fields
}
App represents a single application that can manage Shorewall configurations. This solves the problem of having multiple independent application managing Shorewall in the same system. App use a random generated identifier to isolate its configuration from other applications. This identifier must be saved by the application to be able to manage its Shorewall configuration across restarts. App also handles concurrent access to Shorewall configuration files.
func AppFromID ¶ added in v0.0.7
AppFromID creates an App instance from a previously saved identifier.
func AppFromIDAndBasePath ¶ added in v0.0.7
func NewApp ¶ added in v0.0.7
NewApp creates a new App with a random generated identifier. This must be called only once per application installation. After saving the identifier with App.ID(), the application should use AppFromID to retrieve the App instance on subsequent runs.
func NewAppWithBasePath ¶ added in v0.0.7
func (*App) AddInterface ¶ added in v0.0.7
AddInterface adds a new interface to the Shorewall configuration managed by the App instance.
func (*App) AddPolicy ¶ added in v0.0.7
AddPolicy adds a new policy to the Shorewall configuration managed by the App instance.
func (*App) AddRule ¶ added in v0.0.7
AddRule adds a new rule to the Shorewall configuration managed by the App instance.
func (*App) AddSnat ¶ added in v0.0.7
AddSnat adds a new SNAT to the Shorewall configuration managed by the App instance.
func (*App) AddZone ¶ added in v0.0.7
AddZone adds a new zone to the Shorewall configuration managed by the App instance.
func (*App) BasePath ¶ added in v0.0.7
BasePath returns the Shorewall configuration base path used by the App instance.
func (*App) InterfaceFilePath ¶ added in v0.0.7
InterfaceFilePath returns the full path to the interfaces file used by the App instance.
func (*App) Interfaces ¶ added in v0.0.7
Interfaces returns the list of interfaces managed by the App instance.
func (*App) Policies ¶ added in v0.0.7
Policies returns the list of policies managed by the App instance.
func (*App) PolicyFilePath ¶ added in v0.0.7
PolicyFilePath returns the full path to the policy file used by the App instance.
func (*App) RemoveInterfaceByZone ¶ added in v0.0.7
RemoveInterfaceByZone removes all interfaces associated with the specified zone
func (*App) RemovePolicy ¶ added in v0.0.7
RemovePolicy removes a policy from the Shorewall configuration managed by the App instance.
func (*App) RemoveRule ¶ added in v0.0.7
RemoveRule removes a rule from the Shorewall configuration managed by the App instance.
func (*App) RemoveSnat ¶ added in v0.0.7
RemoveSnat removes a SNAT from the Shorewall configuration managed by the App instance.
func (*App) RemoveZone ¶ added in v0.0.7
RemoveZone removes a zone from the Shorewall configuration managed by the App instance.
func (*App) RulesFilePath ¶ added in v0.0.7
RulesFilePath returns the full path to the rules file used by the App instance.
func (*App) SnatFilePath ¶ added in v0.0.7
SnatFilePath returns the full path to the snat file used by the App instance.
func (*App) ZonesFilePath ¶ added in v0.0.7
ZonesFilePath returns the full path to the zones file used by the App instance.