middleware

package
v1.7.12 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bans

func Bans() gin.HandlerFunc

Bans will check ip with the banned list

func CheckBannedIps

func CheckBannedIps(ip string) (check bool, err error)

CheckBannedIps will check the database for the ip

func CheckScamalytics added in v1.5.0

func CheckScamalytics(ip string) (err error)

CheckScamalytics will query blacklist api for IP

func CheckStopForumSpam

func CheckStopForumSpam(ip string) (err error)

CheckStopForumSpam will query blacklist api for IP

func Goodnight added in v1.7.10

func Goodnight() gin.HandlerFunc

Goodnight will disable posting during a time range

func Scamalytics added in v1.5.0

func Scamalytics() gin.HandlerFunc

Scamalytics check ip with scamalytics

func SpamFilter added in v1.7.1

func SpamFilter() gin.HandlerFunc

SpamFilter will check for banned words in the post

func StopSpam

func StopSpam() gin.HandlerFunc

StopSpam check ip with stop forum spam

Types

type ScamalyticsResponse added in v1.5.0

type ScamalyticsResponse struct {
	Status  string `json:"status"`
	Mode    string `json:"mode"`
	IP      string `json:"ip"`
	Score   int    `json:"score"`
	Risk    string `json:"risk"`
	URL     string `json:"url"`
	Credits struct {
		Used                        int    `json:"used"`
		Remaining                   int    `json:"remaining"`
		LastSyncTimestampUtc        string `json:"last_sync_timestamp_utc"`
		SecondsElapsedSinceLastSync int    `json:"seconds_elapsed_since_last_sync"`
		Note                        string `json:"note"`
	} `json:"credits"`
	Exec string `json:"exec"`
}

type StopForumSpam

type StopForumSpam struct {
	IP struct {
		Appears    float64 `json:"appears"`
		Confidence float64 `json:"confidence"`
		Frequency  float64 `json:"frequency"`
		Lastseen   string  `json:"lastseen"`
	} `json:"ip"`
	Success float64 `json:"success"`
}

StopForumSpam is the request return format

Jump to

Keyboard shortcuts

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