summaryrefslogtreecommitdiff
path: root/internal/db/application.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2024-04-15 14:22:21 +0100
committerLibravatar GitHub <noreply@github.com>2024-04-15 14:22:21 +0100
commitf79d50b9b26590b6d2468aeb41f0846272e08d1a (patch)
tree196b9bfaf8ad6fce782c2130633cfb5c97cbd31a /internal/db/application.go
parent[chore] Turn `accounts-registration-open` false by default (#2839) (diff)
downloadgotosocial-f79d50b9b26590b6d2468aeb41f0846272e08d1a.tar.xz
[performance] cached oauth database types (#2838)
* update token + client code to use struct caches * add code comments * slight tweak to default mem ratios * fix envparsing * add appropriate invalidate hooks * update the tokenstore sweeping function to rely on caches * update to use PutClient() * add ClientID to list of token struct indices
Diffstat (limited to 'internal/db/application.go')
-rw-r--r--internal/db/application.go36
1 files changed, 36 insertions, 0 deletions
diff --git a/internal/db/application.go b/internal/db/application.go
index 34a857d3f..b71e593c2 100644
--- a/internal/db/application.go
+++ b/internal/db/application.go
@@ -35,4 +35,40 @@ type Application interface {
// DeleteApplicationByClientID deletes the application with corresponding client_id value from the database.
DeleteApplicationByClientID(ctx context.Context, clientID string) error
+
+ // GetClientByID ...
+ GetClientByID(ctx context.Context, id string) (*gtsmodel.Client, error)
+
+ // PutClient ...
+ PutClient(ctx context.Context, client *gtsmodel.Client) error
+
+ // DeleteClientByID ...
+ DeleteClientByID(ctx context.Context, id string) error
+
+ // GetAllTokens ...
+ GetAllTokens(ctx context.Context) ([]*gtsmodel.Token, error)
+
+ // GetTokenByCode ...
+ GetTokenByCode(ctx context.Context, code string) (*gtsmodel.Token, error)
+
+ // GetTokenByAccess ...
+ GetTokenByAccess(ctx context.Context, access string) (*gtsmodel.Token, error)
+
+ // GetTokenByRefresh ...
+ GetTokenByRefresh(ctx context.Context, refresh string) (*gtsmodel.Token, error)
+
+ // PutToken ...
+ PutToken(ctx context.Context, token *gtsmodel.Token) error
+
+ // DeleteTokenByID ...
+ DeleteTokenByID(ctx context.Context, id string) error
+
+ // DeleteTokenByCode ...
+ DeleteTokenByCode(ctx context.Context, code string) error
+
+ // DeleteTokenByAccess ...
+ DeleteTokenByAccess(ctx context.Context, access string) error
+
+ // DeleteTokenByRefresh ...
+ DeleteTokenByRefresh(ctx context.Context, refresh string) error
}