Documentation
¶
Index ¶
- Constants
- func CanonicalizeUsername(name string) string
- func Denormalize(fullName string) string
- func FallbackUsername(userID int64, suffix int) string
- func NameAllowed(fullName string) bool
- func Normalize(fullName string) string
- func NormalizeDisplayName(name string) string
- func ReservedUsername(name string) bool
- func Split(fullName string) (category, name string)
- func SplitSiteRef(fullName string) (slug, name string)
- type DisplayNameProblem
Constants ¶
const (
DefaultCategory = "_default"
)
Variables ¶
This section is empty.
Functions ¶
func CanonicalizeUsername ¶
Unlike Normalize this keeps non-Latin letters, so a Chinese name canonicalizes to itself rather than to an empty string. Every run that is neither a letter nor a number collapses, the underscore included.
func Denormalize ¶
func FallbackUsername ¶
func NameAllowed ¶
func NormalizeDisplayName ¶
func ReservedUsername ¶
func SplitSiteRef ¶
SplitSiteRef reads the ":slug:category:page" form an include may use to name another wiki. A ref without the leading colon names no site and comes back whole.
Types ¶
type DisplayNameProblem ¶
type DisplayNameProblem int
const ( DisplayNameOK DisplayNameProblem = iota DisplayNameEmpty DisplayNameTooLong DisplayNameInvisible DisplayNameOddSpace DisplayNameLeadingMark )
func ValidateDisplayName ¶
func ValidateDisplayName(name string) DisplayNameProblem