start working on struct validation for gtsmodel

This commit is contained in:
tsmethurst 2021-08-29 16:52:23 +02:00
commit 8aa72f995f
10 changed files with 407 additions and 125 deletions

View file

@ -90,6 +90,7 @@ var (
followPathRegex = regexp.MustCompile(followPathRegexString)
ulidRegexString = `[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}`
ulidRegex = regexp.MustCompile(fmt.Sprintf(`^%s$`, ulidRegexString))
likedPathRegexString = fmt.Sprintf(`^/?%s/(%s)/%s$`, UsersPath, usernameRegexString, LikedPath)
// likedPathRegex parses a path that validates and captures the username part from eg /users/example_username/liked