summaryrefslogtreecommitdiff
path: root/internal/db/instance.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2021-08-25 15:34:33 +0200
committerLibravatar GitHub <noreply@github.com>2021-08-25 15:34:33 +0200
commit2dc9fc1626507bb54417fc4a1920b847cafb27a2 (patch)
tree4ddeac479b923db38090aac8bd9209f3646851c1 /internal/db/instance.go
parentManually approves followers (#146) (diff)
downloadgotosocial-2dc9fc1626507bb54417fc4a1920b847cafb27a2.tar.xz
Pg to bun (#148)
* start moving to bun * changing more stuff * more * and yet more * tests passing * seems stable now * more big changes * small fix * little fixes
Diffstat (limited to 'internal/db/instance.go')
-rw-r--r--internal/db/instance.go14
1 files changed, 9 insertions, 5 deletions
diff --git a/internal/db/instance.go b/internal/db/instance.go
index 1f7c83e4f..dcd978a81 100644
--- a/internal/db/instance.go
+++ b/internal/db/instance.go
@@ -18,19 +18,23 @@
package db
-import "github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
+import (
+ "context"
+
+ "github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
+)
// Instance contains functions for instance-level actions (counting instance users etc.).
type Instance interface {
// CountInstanceUsers returns the number of known accounts registered with the given domain.
- CountInstanceUsers(domain string) (int, Error)
+ CountInstanceUsers(ctx context.Context, domain string) (int, Error)
// CountInstanceStatuses returns the number of known statuses posted from the given domain.
- CountInstanceStatuses(domain string) (int, Error)
+ CountInstanceStatuses(ctx context.Context, domain string) (int, Error)
// CountInstanceDomains returns the number of known instances known that the given domain federates with.
- CountInstanceDomains(domain string) (int, Error)
+ CountInstanceDomains(ctx context.Context, domain string) (int, Error)
// GetInstanceAccounts returns a slice of accounts from the given instance, arranged by ID.
- GetInstanceAccounts(domain string, maxID string, limit int) ([]*gtsmodel.Account, Error)
+ GetInstanceAccounts(ctx context.Context, domain string, maxID string, limit int) ([]*gtsmodel.Account, Error)
}