antispam

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

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 any, 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