outputs

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadOutputProfiles

func LoadOutputProfiles(profileConfig string) ([]types.Profile, error)

func OvflwToOrder

func OvflwToOrder(sig types.SignalOccurence, prof types.Profile) (*types.BanOrder, error, error)

Transform an overflow (SignalOccurence) and a Profile into a BanOrder

Types

type Output

type Output struct {
	API *cwapi.ApiCtx

	Config *OutputFactory
	// contains filtered or unexported fields
}

Output holds the runtime objects of backend

func NewOutput

func NewOutput(config *OutputFactory) (*Output, error)

func (*Output) Delete

func (o *Output) Delete(target string) (int, error)

func (*Output) DeleteAll

func (o *Output) DeleteAll() error

func (*Output) Flush

func (o *Output) Flush() error

func (*Output) FlushAll

func (o *Output) FlushAll()

func (*Output) InitAPI

func (o *Output) InitAPI(config map[string]string) error

func (*Output) Insert

func (o *Output) Insert(sig types.SignalOccurence) error

func (*Output) LoadAPIConfig

func (o *Output) LoadAPIConfig(configFile string) error

func (*Output) ProcessOutput

func (o *Output) ProcessOutput(sig types.SignalOccurence, profiles []types.Profile) error

func (*Output) ReadAT

func (o *Output) ReadAT(timeAT time.Time) ([]map[string]string, error)

func (*Output) Shutdown added in v0.2.0

func (o *Output) Shutdown() error

func (*Output) StartAutoCommit added in v0.2.3

func (o *Output) StartAutoCommit() error

type OutputFactory

type OutputFactory struct {
	BackendFolder string `yaml:"backend,omitempty"`
	//For the db GC : how many records can we keep at most
	MaxRecords string `yaml:"max_records,omitempty"`
	//For the db GC what is the oldest records we tolerate
	MaxRecordsAge string `yaml:"max_records_age,omitempty"`
	//Should we automatically flush expired bans
	Flush bool
	Debug bool `yaml:"debug"`
}

OutputFactory is part of the main yaml configuration file, and holds generic backend config

Jump to

Keyboard shortcuts

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