helpers

package
v0.36.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckRateLimit

func CheckRateLimit(
	w http.ResponseWriter,
	r *http.Request,
	endpoint string,
	disableRateLimit bool,
	customCheck func(ip string, endpoint string) (allowed bool, retryAfter time.Duration, err error),
	limiter *utils.InMemoryRateLimiter,
	hooks types.ObservabilityHooks,
) bool

CheckRateLimit verifies if a request should be allowed based on rate limiting rules. It returns true if allowed, false if rate limited.

func GetClientIP

func GetClientIP(r *http.Request) string

GetClientIP extracts the client IP from the request. It checks X-Forwarded-For and X-Real-IP headers first, then falls back to RemoteAddr.

func Layout

func Layout(content string) string

Layout builds the default HTML layout for auth pages.

Types

This section is empty.

Jump to

Keyboard shortcuts

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