mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[feature] Implement Report database model and utility functions (#1310)
* implement report database model * implement report cache + config changes * implement report database functions * report uri / regex functions * update envparsing test * remove unnecessary uri index * remove unused function + cache lookup * process error when storing report
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user