domain

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeLength     = 6
	CodeTTL        = 10 * time.Minute
	CodeMaxTries   = 5
	ResendCooldown = time.Minute
)
View Source
const (
	ResetLinkTTL  = time.Hour
	VerifyLinkTTL = 24 * time.Hour
)
View Source
const AvatarURLMaxLen = 2048
View Source
const DefaultPATPrefix = "tk_"
View Source
const DisplayNameMaxLen = 100

Variables

View Source
var ReservedSlugs = map[string]bool{
	"api": true, "www": true, "app": true, "admin": true, "mail": true,
	"static": true, "assets": true, "auth": true, "support": true, "billing": true,
}

Functions

func AvatarURLOK

func AvatarURLOK(raw string) bool

func CodeExpiry

func CodeExpiry(now time.Time) time.Time

func CodeOK

func CodeOK(code string) bool

func EmailOK

func EmailOK(email string) bool

func EmailWhitelisted

func EmailWhitelisted(email string, allowedEmails, allowedDomains []string) bool

func HashPAT

func HashPAT(token string) string

func HashSecret

func HashSecret(pepper, value string) string

func IsPATFormat

func IsPATFormat(prefix, token string) bool

func IssueCode

func IssueCode() (string, error)

func MintLinkToken

func MintLinkToken() (string, error)

func MintPAT

func MintPAT(prefix string) (token, hash, display string, err error)

func NormalizeDisplayName

func NormalizeDisplayName(raw string) (string, bool)

func NormalizeEmail

func NormalizeEmail(email string) string

func PasswordOK

func PasswordOK(pw string) bool

func SignupAllowed

func SignupAllowed(email string, allowedEmails, allowedDomains []string) bool

func SlugOK

func SlugOK(slug string) bool

func SlugReserved

func SlugReserved(slug string) bool

func UUIDOK

func UUIDOK(s string) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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