Documentation
¶
Index ¶
- type Config
- type ConnectionPuller
- type ConnectionRest
- type ConnectionRouterOsApi
- type ConnectionSSHCfg
- type DeviceConstructor
- type DeviceController
- func (ctx *DeviceController) CleanupTrashRules(comment comment.IRuleComment) error
- func (ctx *DeviceController) FindRuleIdByComment(comment string, forceRefresh bool) (uint64, error)
- func (ctx *DeviceController) GetRules(forceRefresh bool) ([]firewallCommon.FirewallRule, error)
- func (ctx *DeviceController) GetRulesFiltered(filter comment.IRuleComment, forceRefresh bool) ([]firewallCommon.FirewallRule, error)
- func (ctx *DeviceController) RemoveBatch(ids []uint64) error
- func (ctx *DeviceController) RunCommandWithReply(cmd device.IDeviceCommand) (device.IDeviceResponse, error)
- func (ctx *DeviceController) Start() error
- func (ctx *DeviceController) Stop() error
- func (ctx *DeviceController) UnmarshalYAML(value *yaml.Node) error
- type DevicePuller
- type DeviceRest
- type DeviceRouterOsApi
- func (ctx *DeviceRouterOsApi) Connect()
- func (ctx *DeviceRouterOsApi) Disconnect()
- func (ctx *DeviceRouterOsApi) IsConnected() bool
- func (ctx *DeviceRouterOsApi) RunCommandWithReply(command device.IDeviceCommand) (device.IDeviceResponse, error)
- func (ctx *DeviceRouterOsApi) SetProtocol(protocol firewallProtocol.IFirewallProtocol)
- func (ctx *DeviceRouterOsApi) Start() error
- func (ctx *DeviceRouterOsApi) Stop() error
- type DeviceSsh
- func (ctx *DeviceSsh) RunCommandWithReply(command device.IDeviceCommand) (device.IDeviceResponse, error)
- func (ctx *DeviceSsh) RunSSHCommandWithReply(cmd string) (string, error)
- func (ctx *DeviceSsh) SetProtocol(protocol firewallProtocol.IFirewallProtocol)
- func (ctx *DeviceSsh) Start() error
- func (ctx *DeviceSsh) Stop() error
- type DeviceStorage
- type IDevice
- type IFirewallRestProtocol
- type IFirewallSshProtocol
- type VirtualFirewall
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectionPuller ¶
type ConnectionRest ¶
type ConnectionRouterOsApi ¶
type ConnectionSSHCfg ¶
type ConnectionSSHCfg struct { Username string `yaml:"username"` Password string `yaml:"password"` Host string `yaml:"host"` Port uint16 `yaml:"port"` KnownHosts string `yaml:"knownHosts"` PrivateKeyPath string `yaml:"private-key"` PrivateKeyPassphrase string `yaml:"private-key-passphrase"` ConnectionKeepAliveTimeout common.DurationSeconds `yaml:"connection-keep-alive"` }
type DeviceConstructor ¶
type DeviceConstructor interface {
Construct(*yaml.Node, firewallProtocol.IFirewallProtocol) (IDevice, error)
}
type DeviceController ¶
type DeviceController struct { Device IDevice Config Config // contains filtered or unexported fields }
func DeviceControllerNew ¶
func DeviceControllerNew(device IDevice) *DeviceController
func (*DeviceController) CleanupTrashRules ¶
func (ctx *DeviceController) CleanupTrashRules(comment comment.IRuleComment) error
func (*DeviceController) FindRuleIdByComment ¶
func (ctx *DeviceController) FindRuleIdByComment(comment string, forceRefresh bool) (uint64, error)
func (*DeviceController) GetRules ¶
func (ctx *DeviceController) GetRules(forceRefresh bool) ([]firewallCommon.FirewallRule, error)
func (*DeviceController) GetRulesFiltered ¶
func (ctx *DeviceController) GetRulesFiltered(filter comment.IRuleComment, forceRefresh bool) ([]firewallCommon.FirewallRule, error)
func (*DeviceController) RemoveBatch ¶
func (ctx *DeviceController) RemoveBatch(ids []uint64) error
func (*DeviceController) RunCommandWithReply ¶
func (ctx *DeviceController) RunCommandWithReply(cmd device.IDeviceCommand) (device.IDeviceResponse, error)
func (*DeviceController) Start ¶
func (ctx *DeviceController) Start() error
func (*DeviceController) Stop ¶
func (ctx *DeviceController) Stop() error
func (*DeviceController) UnmarshalYAML ¶
func (ctx *DeviceController) UnmarshalYAML(value *yaml.Node) error
type DevicePuller ¶
type DevicePuller struct {
// contains filtered or unexported fields
}
func DevicePullerNew ¶
func DevicePullerNew(cfg ConnectionPuller) *DevicePuller
func (*DevicePuller) RunCommandWithReply ¶
func (ctx *DevicePuller) RunCommandWithReply( cmd device.IDeviceCommand, ) (device.IDeviceResponse, error)
func (*DevicePuller) SetProtocol ¶
func (ctx *DevicePuller) SetProtocol(protocol firewallProtocol.IFirewallProtocol)
func (*DevicePuller) Start ¶
func (ctx *DevicePuller) Start() error
func (*DevicePuller) Stop ¶
func (ctx *DevicePuller) Stop() error
type DeviceRest ¶
type DeviceRest struct {
// contains filtered or unexported fields
}
func DeviceRestNew ¶
func DeviceRestNew(cfg ConnectionRest) *DeviceRest
func (*DeviceRest) RunCommandWithReply ¶
func (ctx *DeviceRest) RunCommandWithReply(command device.IDeviceCommand) (device.IDeviceResponse, error)
func (*DeviceRest) SetProtocol ¶
func (ctx *DeviceRest) SetProtocol(protocol firewallProtocol.IFirewallProtocol)
func (*DeviceRest) Start ¶
func (ctx *DeviceRest) Start() error
func (*DeviceRest) Stop ¶
func (ctx *DeviceRest) Stop() error
type DeviceRouterOsApi ¶
type DeviceRouterOsApi struct {
// contains filtered or unexported fields
}
func DeviceRouterOsNew ¶
func DeviceRouterOsNew(cfg ConnectionRouterOsApi) *DeviceRouterOsApi
func (*DeviceRouterOsApi) Connect ¶
func (ctx *DeviceRouterOsApi) Connect()
func (*DeviceRouterOsApi) Disconnect ¶
func (ctx *DeviceRouterOsApi) Disconnect()
func (*DeviceRouterOsApi) IsConnected ¶
func (ctx *DeviceRouterOsApi) IsConnected() bool
func (*DeviceRouterOsApi) RunCommandWithReply ¶
func (ctx *DeviceRouterOsApi) RunCommandWithReply(command device.IDeviceCommand) (device.IDeviceResponse, error)
func (*DeviceRouterOsApi) SetProtocol ¶
func (ctx *DeviceRouterOsApi) SetProtocol(protocol firewallProtocol.IFirewallProtocol)
func (*DeviceRouterOsApi) Start ¶
func (ctx *DeviceRouterOsApi) Start() error
func (*DeviceRouterOsApi) Stop ¶
func (ctx *DeviceRouterOsApi) Stop() error
type DeviceSsh ¶
type DeviceSsh struct {
// contains filtered or unexported fields
}
func DeviceSshNew ¶
func DeviceSshNew(cfg ConnectionSSHCfg) *DeviceSsh
func (*DeviceSsh) RunCommandWithReply ¶
func (ctx *DeviceSsh) RunCommandWithReply(command device.IDeviceCommand) (device.IDeviceResponse, error)
func (*DeviceSsh) RunSSHCommandWithReply ¶
func (*DeviceSsh) SetProtocol ¶
func (ctx *DeviceSsh) SetProtocol(protocol firewallProtocol.IFirewallProtocol)
type DeviceStorage ¶
type DeviceStorage struct {
// contains filtered or unexported fields
}
func GetDeviceStorage ¶
func GetDeviceStorage() *DeviceStorage
func (*DeviceStorage) GetDevice ¶
func (ctx *DeviceStorage) GetDevice(name string, node *yaml.Node) (IDevice, error)
func (*DeviceStorage) Init ¶
func (ctx *DeviceStorage) Init()
type IDevice ¶
type IDevice interface { SetProtocol(protocol firewallProtocol.IFirewallProtocol) Start() error Stop() error RunCommandWithReply(cmd device.IDeviceCommand) (device.IDeviceResponse, error) }
func DevicePullerNewFromYaml ¶
func DeviceRestNewFromYaml ¶
func DeviceSshNewFromYaml ¶
type IFirewallRestProtocol ¶
type IFirewallRestProtocol interface { firewallProtocol.IFirewallProtocol To(cmd device.IDeviceCommand, baseUrl string) (*http.Request, error) From(httpResponse *http.Response, cmdType device.DeviceCommandType) (device.IDeviceResponse, error) }
type IFirewallSshProtocol ¶
type IFirewallSshProtocol interface { firewallProtocol.IFirewallProtocol To(cmd device.IDeviceCommand) (string, error) From(responseData string, cmdType device.DeviceCommandType) (device.IDeviceResponse, error) }
Click to show internal directories.
Click to hide internal directories.