Documentation ¶
Index ¶
- func CustomCSS(customCSS string) error
- func DisplayName(displayName string) error
- func Email(email string) error
- func EmojiCategory(category string) error
- func EmojiShortcode(shortcode string) error
- func FilterContexts(contexts []apimodel.FilterContext) error
- func FilterKeyword(keyword string) error
- func Language(lang string) (string, error)
- func ListRepliesPolicy(repliesPolicy gtsmodel.RepliesPolicy) error
- func ListTitle(title string) error
- func MarkerName(name string) error
- func Note(note string) error
- func Password(password string) error
- func Privacy(privacy string) error
- func ProfileFields(fields []*gtsmodel.Field) error
- func SignUpReason(reason string, reasonRequired bool) error
- func SiteDescription(d string) error
- func SiteShortDescription(d string) error
- func SiteTerms(t string) error
- func SiteTitle(siteTitle string) error
- func StatusContentType(statusContentType string) error
- func ULID(i string) bool
- func Username(username string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisplayName ¶
DisplayName checks that a requested display name is valid
func Email ¶
Email makes sure that a given email address is a valid address. Returns an error if not.
func EmojiCategory ¶ added in v0.6.0
EmojiCategory validates the length of the given category string.
func EmojiShortcode ¶
EmojiShortcode just runs the given shortcode through the regular expression for emoji shortcodes, to figure out whether it's a valid shortcode, ie., 2-30 characters, a-zA-Z, numbers, and underscores.
func FilterContexts ¶ added in v0.15.0
func FilterContexts(contexts []apimodel.FilterContext) error
FilterContexts validates the context of a new or updated filter.
func FilterKeyword ¶ added in v0.15.0
FilterKeyword validates the title of a new or updated List.
func Language ¶
Language checks that the given language string is a valid, if not necessarily canonical, BCP 47 language tag. Returns a canonicalized version of the tag if the language can be parsed. Returns an error if the language cannot be parsed. See: https://pkg.go.dev/golang.org/x/text/language
func ListRepliesPolicy ¶ added in v0.10.0
func ListRepliesPolicy(repliesPolicy gtsmodel.RepliesPolicy) error
ListRepliesPolicy validates the replies_policy of a new or updated list.
func MarkerName ¶ added in v0.11.0
MarkerName checks that the desired marker timeline name is valid.
func Password ¶ added in v0.11.0
Password returns a helpful error if the given password is too short, too long, or not sufficiently strong.
func ProfileFields ¶ added in v0.9.0
ProfileFields validates the length of provided fields slice, and also iterates through the fields and trims each name + value to maximumProfileFieldLength, if they were above.
func SignUpReason ¶
SignUpReason checks that a sufficient reason is given for a server signup request
func SiteDescription ¶
SiteDescription ensures that the given site description is within spec.
func SiteShortDescription ¶
SiteShortDescription ensures that the given site short description is within spec.
func StatusContentType ¶ added in v0.8.0
StatusContentType checks that the desired status format setting is valid.
Types ¶
This section is empty.