diff options
author | 2023-09-21 12:12:04 +0200 | |
---|---|---|
committer | 2023-09-21 12:12:04 +0200 | |
commit | 183eaa5b298235acb8f25ba8f18b98e31471d965 (patch) | |
tree | 55f42887edeb5206122d92eb30e0eedf145a3615 /internal/cache/gts.go | |
parent | [docs] Add a note on cluster support (#2214) (diff) | |
download | gotosocial-183eaa5b298235acb8f25ba8f18b98e31471d965.tar.xz |
[feature] Implement explicit domain allows + allowlist federation mode (#2200)
* love like winter! wohoah, wohoah
* domain allow side effects
* tests! logging! unallow!
* document federation modes
* linty linterson
* test
* further adventures in documentation
* finish up domain block documentation (i think)
* change wording a wee little bit
* docs, example
* consolidate shared domainPermission code
* call mode once
* fetch federation mode within domain blocked func
* read domain perm import in streaming manner
* don't use pointer to slice for domain perms
* don't bother copying blocks + allows before deleting
* admonish!
* change wording just a scooch
* update docs
Diffstat (limited to 'internal/cache/gts.go')
-rw-r--r-- | internal/cache/gts.go | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/internal/cache/gts.go b/internal/cache/gts.go index 12e917919..16a1585f7 100644 --- a/internal/cache/gts.go +++ b/internal/cache/gts.go @@ -36,7 +36,8 @@ type GTSCaches struct { block *result.Cache[*gtsmodel.Block] blockIDs *SliceCache[string] boostOfIDs *SliceCache[string] - domainBlock *domain.BlockCache + domainAllow *domain.Cache + domainBlock *domain.Cache emoji *result.Cache[*gtsmodel.Emoji] emojiCategory *result.Cache[*gtsmodel.EmojiCategory] follow *result.Cache[*gtsmodel.Follow] @@ -72,6 +73,7 @@ func (c *GTSCaches) Init() { c.initBlock() c.initBlockIDs() c.initBoostOfIDs() + c.initDomainAllow() c.initDomainBlock() c.initEmoji() c.initEmojiCategory() @@ -139,8 +141,13 @@ func (c *GTSCaches) BoostOfIDs() *SliceCache[string] { return c.boostOfIDs } +// DomainAllow provides access to the domain allow database cache. +func (c *GTSCaches) DomainAllow() *domain.Cache { + return c.domainAllow +} + // DomainBlock provides access to the domain block database cache. -func (c *GTSCaches) DomainBlock() *domain.BlockCache { +func (c *GTSCaches) DomainBlock() *domain.Cache { return c.domainBlock } @@ -384,8 +391,12 @@ func (c *GTSCaches) initBoostOfIDs() { )} } +func (c *GTSCaches) initDomainAllow() { + c.domainAllow = new(domain.Cache) +} + func (c *GTSCaches) initDomainBlock() { - c.domainBlock = new(domain.BlockCache) + c.domainBlock = new(domain.Cache) } func (c *GTSCaches) initEmoji() { |