# Functions
ByteSize formats a given number of bytes into a human-readable string representation.
ComparePasswords takes a plain password and creates a hash.
No description provided by the author
GetHash creates an SHA-256 hash of a plain text password and returns the first 128 bits.
IsInNetwork checks if an IP address is part of a list of networks.
IsSoftWhitelisted checks whether a given clientIP is in the soft whitelist associated with a username.
NewDNSResolver creates a new DNS resolver based on the configured settings.
NewHTTPClient creates and returns a new http.Client with a timeout of 60 seconds and custom TLS configurations.
No description provided by the author
ProcessXForwardedFor processes the X-Forwarded-For header in the given Gin context, extracting the forwarded address and updating the client IP and port accordingly.
No description provided by the author
No description provided by the author
ResolveIPAddress returns the hostname for a given IP address.
ValidateUsername validates the given username against the usernamePattern regular expression.
WithNotAvailable returns a default "not available" string if the given value is an empty string.
# Structs
CryptPassword is a container for an encrypted password typically used in SQL fields.
MacroSource holds all values that might be used in macros.
RedisLogger implements the interface redis.Logging.