antispam

package
v0.45.2 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2025 License: BSD-3-Clause Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Antispammer

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

Antispammer makes a decision on the need to parse the input log. It can be useful when any application writes logs at speed faster than File.d can read it.

Anti-spammer supports exceptions for cases where you need to guarantee delivery of an important events.

func NewAntispammer

func NewAntispammer(o *Options) *Antispammer

func (*Antispammer) Dump

func (a *Antispammer) Dump() string

func (*Antispammer) IsSpam

func (a *Antispammer) IsSpam(id string, name string, isNewSource bool, event []byte, timeEvent time.Time) bool

func (*Antispammer) Maintenance

func (a *Antispammer) Maintenance()

type Exception

type Exception struct {
	matchrule.RuleSet
	CheckSourceName bool `json:"check_source_name"`
}

type Exceptions added in v0.34.2

type Exceptions []Exception

func (Exceptions) Prepare added in v0.34.2

func (e Exceptions) Prepare()

type Options

type Options struct {
	MaintenanceInterval time.Duration
	Threshold           int
	UnbanIterations     int
	Exceptions          Exceptions

	Logger            *zap.Logger
	MetricsController *metric.Ctl
	MetricHolder      *metric.Holder
}

Jump to

Keyboard shortcuts

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