ipmonitor

package
v1.5.11 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModeMonitor = "monitor"
	ModeEnforce = "enforce"
)

Variables

View Source
var SecurityEventAuditHook func(clientName string, kind string, payload map[string]any)

SecurityEventAuditHook, when set by app wiring, mirrors enforced security events (e.g. ip_enforced_reject) into the durable audit log. It is a hook rather than a direct call to avoid an import cycle (service imports ipmonitor) and is debounced upstream by shouldPublishSecurityEvent (no audit flooding).

Functions

func Allow

func Allow(clientName string, ip string) bool

func Clear

func Clear(clientName string) error

func Flush

func Flush() error

func FlushTo

func FlushTo(tx *gorm.DB) error

func History

func History(clientName string, limit int) ([]model.ClientIP, error)

func InvalidateAllCache

func InvalidateAllCache()

func Record

func Record(clientName string, ip string)

func ResetCaches

func ResetCaches()

func WarmUp

func WarmUp() error

Types

This section is empty.

Jump to

Keyboard shortcuts

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