utils

package
v0.0.0-...-b2330f6 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EMAIL_REGEX *regexp.Regexp
View Source
var USERNAME_REGEX *regexp.Regexp

Functions

func AssertString

func AssertString(txt string, opts StringOpts) (string, error)

func GenerateAccessToken

func GenerateAccessToken() string

func GetEntityIDFromParams

func GetEntityIDFromParams(c *gin.Context, paramName string) common.Snowflake

func GetEntityIDFromQueryParams

func GetEntityIDFromQueryParams(c *gin.Context, paramName string) common.Snowflake

func GetRegion

func GetRegion() string

func IsProduction

func IsProduction() bool

func LogTimeTaken

func LogTimeTaken(functionName string, startTime time.Time)

func StringOrDefault

func StringOrDefault(args ...string) string

func ValidateEmail

func ValidateEmail(email string) bool

Types

type StringOpts

type StringOpts struct {
	EntityName         string
	ConvertToLowercase bool
	Slugify            bool
	ConvertToUppercase bool
	MaxLength          int
	IsRequired         bool
	IsMarkdown         bool
	EscapeWhitespace   bool
	IsLink             bool
}

Jump to

Keyboard shortcuts

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