summaryrefslogtreecommitdiff
path: root/internal/regexes/regexes.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/regexes/regexes.go')
-rw-r--r--internal/regexes/regexes.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/internal/regexes/regexes.go b/internal/regexes/regexes.go
index 8c5b0b601..4c9d48dac 100644
--- a/internal/regexes/regexes.go
+++ b/internal/regexes/regexes.go
@@ -36,12 +36,10 @@ const (
followers = "followers"
following = "following"
liked = "liked"
- // collections = "collections"
- // featured = "featured"
publicKey = "main-key"
follow = "follow"
- // update = "updates"
- blocks = "blocks"
+ blocks = "blocks"
+ reports = "reports"
)
const (
@@ -141,6 +139,11 @@ var (
// from eg /users/example_username/blocks/01F7XT5JZW1WMVSW1KADS8PVDH
BlockPath = regexp.MustCompile(blockPath)
+ reportPath = fmt.Sprintf(`^/?%s/(%s)$`, reports, ulid)
+ // ReportPath parses a path that validates and captures the ulid part
+ // from eg /reports/01GP3AWY4CRDVRNZKW0TEAMB5R
+ ReportPath = regexp.MustCompile(reportPath)
+
filePath = fmt.Sprintf(`^(%s)/([a-z]+)/([a-z]+)/(%s)\.([a-z]+)$`, ulid, ulid)
// FilePath parses a file storage path of the form [ACCOUNT_ID]/[MEDIA_TYPE]/[MEDIA_SIZE]/[FILE_NAME]
// eg 01F8MH1H7YV1Z7D2C8K2730QBF/attachment/small/01F8MH8RMYQ6MSNY3JM2XT1CQ5.jpeg