domain

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RoleOwner  = "owner"
	RoleAdmin  = "admin"
	RoleMember = "member"
)
View Source
const (
	InviteTTL    = 7 * 24 * time.Hour
	ShareCodeLen = 24
)

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 AssignableRole

func AssignableRole(role string) bool

func CanLeave

func CanLeave(role string, isLastOwner bool) bool

func EmailOK

func EmailOK(email string) bool

func HashShareCode

func HashShareCode(code string) string

func InviteExpiry

func InviteExpiry(now time.Time) time.Time

func LastOwnerProtected

func LastOwnerProtected(targetRole string, targetIsLastOwner bool, action RoleAction) bool

func MintShareCode

func MintShareCode() (string, error)

func NormalizeEmail

func NormalizeEmail(email string) string

func ShareCodeOK

func ShareCodeOK(code string) bool

func SlugOK

func SlugOK(slug string) bool

func SlugReserved

func SlugReserved(slug string) bool

Types

type RoleAction

type RoleAction int
const (
	ActionDemote RoleAction = iota + 1
	ActionRemove
	ActionPromote
)

Jump to

Keyboard shortcuts

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