Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UnpersistBan ¶
UnpersistBan removes an IP from all blacklist files. Uses flock for safe concurrent access.
Returns the number of files modified and any error.
Types ¶
type Result ¶
type Result string
Result indicates the outcome of a persistence operation
func PersistBan ¶
PersistBan adds an IP to the persistent blacklist files. Uses flock for safe concurrent access.
Parameters:
- configDir: base config directory (e.g., /etc/nftban)
- ip: normalized IP address (must be valid)
- reason: ban reason (optional)
- source: determines target file (login/portscan/ddos/persistent/manual)
Returns:
- Result: Created or AlreadyPresent
- string: filename that was written to
- error: on I/O failure or invalid input
Click to show internal directories.
Click to hide internal directories.