Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Script ¶
type Script struct {
// contains filtered or unexported fields
}
A Script is a compiled Tengo script that will be executed on every request in order to provide a final reputation score for an IP.
The script will have a few global variables available:
'ip' is the IP being looked up
'counts' is a map[string]int64 of counters returned from the database in the chosen time interval
'interval' is the duration in seconds of the time interval chosen for this evaluation, so one can compute rates
To return the final reputation score (in the range 0 - 1), the script should set the 'score' variable.
func LoadScript ¶
LoadScript creates a new Script by loading its source from the specified file.
Click to show internal directories.
Click to hide internal directories.