diff options
author | 2023-07-07 11:34:12 +0200 | |
---|---|---|
committer | 2023-07-07 11:34:12 +0200 | |
commit | e70bf8a6c82e3d5c943550b364fc6f8120f6f07e (patch) | |
tree | f408ccff2e6f2451bf95ee9a5d96e5b678d686d5 /internal/db/domain.go | |
parent | [chore/performance] Remove remaining 'whereEmptyOrNull' funcs (#1946) (diff) | |
download | gotosocial-e70bf8a6c82e3d5c943550b364fc6f8120f6f07e.tar.xz |
[chore/bugfix] Domain block tidying up, Implement first pass of `207 Multi-Status` (#1886)
* [chore/refactor] update domain block processing
* expose domain block import errors a lil better
* move/remove unused query keys
Diffstat (limited to 'internal/db/domain.go')
-rw-r--r-- | internal/db/domain.go | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/internal/db/domain.go b/internal/db/domain.go index 8918d6fe8..d859752af 100644 --- a/internal/db/domain.go +++ b/internal/db/domain.go @@ -26,13 +26,19 @@ import ( // Domain contains DB functions related to domains and domain blocks. type Domain interface { - // CreateDomainBlock ... + // CreateDomainBlock puts the given instance-level domain block into the database. CreateDomainBlock(ctx context.Context, block *gtsmodel.DomainBlock) Error - // GetDomainBlock ... + // GetDomainBlock returns one instance-level domain block with the given domain, if it exists. GetDomainBlock(ctx context.Context, domain string) (*gtsmodel.DomainBlock, Error) - // DeleteDomainBlock ... + // GetDomainBlockByID returns one instance-level domain block with the given id, if it exists. + GetDomainBlockByID(ctx context.Context, id string) (*gtsmodel.DomainBlock, Error) + + // GetDomainBlocks returns all instance-level domain blocks currently enforced by this instance. + GetDomainBlocks(ctx context.Context) ([]*gtsmodel.DomainBlock, error) + + // DeleteDomainBlock deletes an instance-level domain block with the given domain, if it exists. DeleteDomainBlock(ctx context.Context, domain string) Error // IsDomainBlocked checks if an instance-level domain block exists for the given domain string (eg., `example.org`). |