[feature] Store admin actions in the db, prevent conflicting actions (#2167)

This commit is contained in:
tobi
2023-09-04 15:55:17 +02:00
committed by GitHub
parent 4f3daeebcb
commit 3ed1ca68e5
23 changed files with 1393 additions and 272 deletions

View File

@ -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
}