Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GinLogger ¶ added in v0.1.19
func GinLogger() gin.HandlerFunc
GinLogger returns a gin middleware that logs request details via slog, so entries appear in both console and the app log file. Logs are structured with status, latency, client_ip, method, path fields. Log level: INFO for 1xx-3xx, WARN for 4xx, ERROR for 5xx.
func IPWhitelist ¶ added in v0.1.13
func IPWhitelist(host string, allowedIPs []string) gin.HandlerFunc
IPWhitelist returns middleware that rejects requests from IPs not in the allowed list. If host is 127.0.0.1 or localhost, all checks are skipped.
func LocalhostOnly ¶
func LocalhostOnly() gin.HandlerFunc
LocalhostOnly returns middleware that restricts access to loopback addresses.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.