summaryrefslogtreecommitdiff
path: root/internal/db/admin.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-09-04 15:55:17 +0200
committerLibravatar GitHub <noreply@github.com>2023-09-04 14:55:17 +0100
commit3ed1ca68e52527f74103e1a57ae48ae533508c3a (patch)
treed6113d71d6f88a3d99bbd2215ead6ca1d4fa6153 /internal/db/admin.go
parent[chore]: Bump golang.org/x/image from 0.11.0 to 0.12.0 (#2178) (diff)
downloadgotosocial-3ed1ca68e52527f74103e1a57ae48ae533508c3a.tar.xz
[feature] Store admin actions in the db, prevent conflicting actions (#2167)
Diffstat (limited to 'internal/db/admin.go')
-rw-r--r--internal/db/admin.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/internal/db/admin.go b/internal/db/admin.go
index 717ac4b94..fcae928f6 100644
--- a/internal/db/admin.go
+++ b/internal/db/admin.go
@@ -49,4 +49,23 @@ type Admin interface {
// Ie., if the instance is hosted at 'example.org' the instance will have a domain of 'example.org'.
// This is needed for things like serving instance information through /api/v1/instance
CreateInstanceInstance(ctx context.Context) error
+
+ /*
+ ACTION FUNCS
+ */
+
+ // GetAdminAction returns the admin action with the given ID.
+ GetAdminAction(ctx context.Context, id string) (*gtsmodel.AdminAction, error)
+
+ // GetAdminActions gets all admin actions from the database.
+ GetAdminActions(ctx context.Context) ([]*gtsmodel.AdminAction, error)
+
+ // PutAdminAction puts one admin action in the database.
+ PutAdminAction(ctx context.Context, action *gtsmodel.AdminAction) error
+
+ // UpdateAdminAction updates one admin action by its ID.
+ UpdateAdminAction(ctx context.Context, action *gtsmodel.AdminAction, columns ...string) error
+
+ // DeleteAdminAction deletes admin action with the given ID.
+ DeleteAdminAction(ctx context.Context, id string) error
}