diff options
author | 2021-07-05 13:23:03 +0200 | |
---|---|---|
committer | 2021-07-05 13:23:03 +0200 | |
commit | d389e7b150df6ecd215c7b661b294ea153ad0103 (patch) | |
tree | 8739e3103cb5130875d903cc7fc72fd9db3b8434 /internal/db/db.go | |
parent | Fix 404 contact (#74) (diff) | |
download | gotosocial-d389e7b150df6ecd215c7b661b294ea153ad0103.tar.xz |
Domain block (#76)
* start work on admin domain blocking
* move stuff around + further work on domain blocks
* move + restructure processor
* prep work for deleting account
* tidy
* go fmt
* formatting
* domain blocking more work
* check domain blocks way earlier on
* progress on delete account
* delete more stuff when an account is gone
* and more...
* domain blocky block block
* get individual domain block, delete a block
Diffstat (limited to 'internal/db/db.go')
-rw-r--r-- | internal/db/db.go | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/internal/db/db.go b/internal/db/db.go index 204f04c71..1ec02d22c 100644 --- a/internal/db/db.go +++ b/internal/db/db.go @@ -65,11 +65,6 @@ type DB interface { // In case of no entries, a 'no entries' error will be returned GetWhere(where []Where, i interface{}) error - // // GetWhereMany gets one entry where key = value for *ALL* parameters passed as "where". - // // That is, if you pass 2 'where' entries, with 1 being Key username and Value test, and the second - // // being Key domain and Value example.org, only entries will be returned where BOTH conditions are true. - // GetWhereMany(i interface{}, where ...model.Where) error - // GetAll will try to get all entries of type i. // The given interface i will be set to the result of the query, whatever it is. Use a pointer or a slice. // In case of no entries, a 'no entries' error will be returned @@ -155,11 +150,11 @@ type DB interface { // CountStatusesByAccountID is a shortcut for the common action of counting statuses produced by accountID. CountStatusesByAccountID(accountID string) (int, error) - // GetStatusesByTimeDescending is a shortcut for getting the most recent statuses. accountID is optional, if not provided + // GetStatusesForAccount is a shortcut for getting the most recent statuses. accountID is optional, if not provided // then all statuses will be returned. If limit is set to 0, the size of the returned slice will not be limited. This can // be very memory intensive so you probably shouldn't do this! // In case of no entries, a 'no entries' error will be returned - GetStatusesByTimeDescending(accountID string, statuses *[]gtsmodel.Status, limit int, excludeReplies bool, maxID string, pinned bool, mediaOnly bool) error + GetStatusesForAccount(accountID string, limit int, excludeReplies bool, maxID string, pinnedOnly bool, mediaOnly bool) ([]*gtsmodel.Status, error) // GetLastStatusForAccountID simply gets the most recent status by the given account. // The given slice 'status' pointer will be set to the result of the query, whatever it is. @@ -261,6 +256,10 @@ type DB interface { // GetDomainCountForInstance returns the number of known instances known that the given domain federates with. GetDomainCountForInstance(domain string) (int, error) + + // GetAccountsForInstance returns a slice of accounts from the given instance, arranged by ID. + GetAccountsForInstance(domain string, maxID string, limit int) ([]*gtsmodel.Account, error) + /* USEFUL CONVERSION FUNCTIONS */ |