shared

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Validate *validator.Validate
)

Functions

func CreateShort added in v0.3.0

func CreateShort() string

func GetIP added in v0.1.0

func GetIP(r *http.Request) string

GetIP extracts the client IP address from the HTTP request. If behind a reverse proxy (BEHIND_PROXY=true), it trusts X-Forwarded-For or X-Real-IP headers. Otherwise, it uses RemoteAddr which cannot be spoofed.

func InitValidator

func InitValidator()

func IsBrowser added in v0.7.0

func IsBrowser(r *http.Request) bool

IsBrowser checks if the User-Agent indicates a web browser

func ValidateIsNotPrivateIP added in v0.1.0

func ValidateIsNotPrivateIP(fl validator.FieldLevel) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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