Documentation ¶
Index ¶
- Variables
- func NewDefaultExecutor() *defaultExecutor
- func NewTestFaultyExecutor(output string, exitCode int, err error, name string, args ...string) *testFaultyExecutor
- func RegisterAction(name string, afn func() Action)
- func RegisterBackend(name string, bfn func(*Runner) Backend)
- func RegisterSource(name string, fn func() Source)
- type Action
- type Backend
- type Configuration
- type Executor
- type Match
- type Rule
- type Runner
- type Source
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultChainName = "gerberos" DefaultTable4Name = "gerberos4" DefaultTable6Name = "gerberos6" )
View Source
var ( ErrMissingSource = errors.New("missing source") ErrEmptySource = errors.New("empty source") ErrUnknownSource = errors.New("unknown source") ErrMissingAction = errors.New("missing action") ErrEmptyAction = errors.New("empty action") ErrUnknownAction = errors.New("unknown action") ErrMissingIntervalParameter = errors.New("missing interval parameter") ErrInvalidIntervalParameter = errors.New("failed to parse interval parameter") ErrMissingRegexp = errors.New("missing regexp") ErrEmptyRegexp = errors.New("empty regexp") ErrMissingCountParameter = errors.New("missing count parameter") ErrInvalidCountParameter = errors.New("failed to parse count parameter") )
Functions ¶
func NewDefaultExecutor ¶ added in v0.0.2
func NewDefaultExecutor() *defaultExecutor
func NewTestFaultyExecutor ¶ added in v0.0.3
func RegisterAction ¶ added in v0.0.4
func RegisterBackend ¶ added in v0.0.4
func RegisterSource ¶ added in v0.0.4
Types ¶
type Action ¶ added in v0.0.4
func NewBanAction ¶ added in v0.0.4
func NewBanAction() Action
func NewLogAction ¶ added in v0.0.4
func NewLogAction() Action
func NewTestAction ¶ added in v0.0.4
func NewTestAction() Action
type Backend ¶ added in v0.0.2
type Backend interface { Initialize() error Ban(ip string, ipv6 bool, d time.Duration) error Finalize() error }
func NewIpsetBackend ¶ added in v0.0.2
func NewNftBackend ¶ added in v0.0.2
func NewTestBackend ¶ added in v0.0.2
type Configuration ¶
type Configuration struct { Verbose bool Backend string SaveFilePath string DisallowInit bool DisallowClear bool Rules map[string]*Rule }
func (*Configuration) ReadFile ¶
func (c *Configuration) ReadFile(path string) error
type Match ¶ added in v0.0.4
func (Match) StringExtended ¶ added in v0.0.4
type Rule ¶ added in v0.0.3
type Rule struct { Source []string Regexp []string Action []string Aggregate []string Occurrences []string // contains filtered or unexported fields }
func (*Rule) MatchAggregate ¶ added in v0.0.4
type Runner ¶ added in v0.0.2
type Runner struct { Configuration *Configuration Executor Executor // contains filtered or unexported fields }
func NewRunner ¶
func NewRunner(c *Configuration) *Runner
func (*Runner) Initialize ¶ added in v0.0.2
type Source ¶ added in v0.0.4
func NewFileSource ¶ added in v0.0.4
func NewFileSource() Source
func NewKernelSource ¶ added in v0.0.4
func NewKernelSource() Source
func NewProcessSource ¶ added in v0.0.4
func NewProcessSource() Source
func NewSystemdSource ¶ added in v0.0.4
func NewSystemdSource() Source
func NewTestSource ¶ added in v0.0.4
func NewTestSource() Source
Source Files ¶
Click to show internal directories.
Click to hide internal directories.