Documentation ¶
Index ¶
- Constants
- Variables
- type APCaches
- type CachedVisibility
- type Caches
- type GTSCaches
- func (c *GTSCaches) Account() *result.Cache[*gtsmodel.Account]
- func (c *GTSCaches) Block() *result.Cache[*gtsmodel.Block]
- func (c *GTSCaches) DomainBlock() *domain.BlockCache
- func (c *GTSCaches) Emoji() *result.Cache[*gtsmodel.Emoji]
- func (c *GTSCaches) EmojiCategory() *result.Cache[*gtsmodel.EmojiCategory]
- func (c *GTSCaches) Follow() *result.Cache[*gtsmodel.Follow]
- func (c *GTSCaches) FollowRequest() *result.Cache[*gtsmodel.FollowRequest]
- func (c *GTSCaches) Init()
- func (c *GTSCaches) Instance() *result.Cache[*gtsmodel.Instance]
- func (c *GTSCaches) List() *result.Cache[*gtsmodel.List]
- func (c *GTSCaches) ListEntry() *result.Cache[*gtsmodel.ListEntry]
- func (c *GTSCaches) Media() *result.Cache[*gtsmodel.MediaAttachment]
- func (c *GTSCaches) Mention() *result.Cache[*gtsmodel.Mention]
- func (c *GTSCaches) Notification() *result.Cache[*gtsmodel.Notification]
- func (c *GTSCaches) Report() *result.Cache[*gtsmodel.Report]
- func (c *GTSCaches) Start()
- func (c *GTSCaches) Status() *result.Cache[*gtsmodel.Status]
- func (c *GTSCaches) StatusFave() *result.Cache[*gtsmodel.StatusFave]
- func (c *GTSCaches) Stop()
- func (c *GTSCaches) Tombstone() *result.Cache[*gtsmodel.Tombstone]
- func (c *GTSCaches) User() *result.Cache[*gtsmodel.User]
- func (c *GTSCaches) Webfinger() *ttl.Cache[string, string]
- type VisibilityCache
- type VisibilityType
Constants ¶
const ( // Possible cache visibility lookup types. VisibilityTypeAccount = VisibilityType('a') VisibilityTypeStatus = VisibilityType('s') VisibilityTypeHome = VisibilityType('h') VisibilityTypePublic = VisibilityType('p') )
Variables ¶
var SentinelError = errors.New("BUG: error should not be returned") //nolint:revive
SentinelError is returned to indicate a non-permanent error return, i.e. a situation in which we do not want a cache a negative result.
Functions ¶
This section is empty.
Types ¶
type APCaches ¶ added in v0.7.0
type APCaches struct{}
func (*APCaches) Init ¶ added in v0.7.0
func (c *APCaches) Init()
Init will initialize all the ActivityPub caches in this collection. NOTE: the cache MUST NOT be in use anywhere, this is not thread-safe.
type CachedVisibility ¶ added in v0.8.0
type CachedVisibility struct { // ItemID is the ID of the item in question (status / account). ItemID string // RequesterID is the ID of the requesting account for this visibility lookup. RequesterID string // Type is the visibility lookup type. Type VisibilityType // Value is the actual visibility value. Value bool }
CachedVisibility represents a cached visibility lookup value.
type Caches ¶ added in v0.7.0
type Caches struct { // GTS provides access to the collection of gtsmodel object caches. // (used by the database). GTS GTSCaches // AP provides access to the collection of ActivityPub object caches. // (planned to be used by the typeconverter). AP APCaches // Visibility provides access to the item visibility cache. // (used by the visibility filter). Visibility VisibilityCache // contains filtered or unexported fields }
func (*Caches) Init ¶ added in v0.7.0
func (c *Caches) Init()
Init will (re)initialize both the GTS and AP cache collections. NOTE: the cache MUST NOT be in use anywhere, this is not thread-safe.
type GTSCaches ¶ added in v0.7.0
type GTSCaches struct {
// contains filtered or unexported fields
}
func (*GTSCaches) Account ¶ added in v0.7.0
Account provides access to the gtsmodel Account database cache.
func (*GTSCaches) Block ¶ added in v0.7.0
Block provides access to the gtsmodel Block (account) database cache.
func (*GTSCaches) DomainBlock ¶ added in v0.7.0
func (c *GTSCaches) DomainBlock() *domain.BlockCache
DomainBlock provides access to the domain block database cache.
func (*GTSCaches) Emoji ¶ added in v0.7.0
Emoji provides access to the gtsmodel Emoji database cache.
func (*GTSCaches) EmojiCategory ¶ added in v0.7.0
func (c *GTSCaches) EmojiCategory() *result.Cache[*gtsmodel.EmojiCategory]
EmojiCategory provides access to the gtsmodel EmojiCategory database cache.
func (*GTSCaches) Follow ¶ added in v0.8.0
Follow provides access to the gtsmodel Follow database cache.
func (*GTSCaches) FollowRequest ¶ added in v0.8.0
func (c *GTSCaches) FollowRequest() *result.Cache[*gtsmodel.FollowRequest]
FollowRequest provides access to the gtsmodel FollowRequest database cache.
func (*GTSCaches) Init ¶ added in v0.7.0
func (c *GTSCaches) Init()
Init will initialize all the gtsmodel caches in this collection. NOTE: the cache MUST NOT be in use anywhere, this is not thread-safe.
func (*GTSCaches) Instance ¶ added in v0.10.0
Instance provides access to the gtsmodel Instance database cache.
func (*GTSCaches) ListEntry ¶ added in v0.10.0
ListEntry provides access to the gtsmodel ListEntry database cache.
func (*GTSCaches) Media ¶ added in v0.8.0
func (c *GTSCaches) Media() *result.Cache[*gtsmodel.MediaAttachment]
Media provides access to the gtsmodel Media database cache.
func (*GTSCaches) Mention ¶ added in v0.7.0
Mention provides access to the gtsmodel Mention database cache.
func (*GTSCaches) Notification ¶ added in v0.7.0
func (c *GTSCaches) Notification() *result.Cache[*gtsmodel.Notification]
Notification provides access to the gtsmodel Notification database cache.
func (*GTSCaches) Report ¶ added in v0.7.0
Report provides access to the gtsmodel Report database cache.
func (*GTSCaches) Start ¶ added in v0.7.0
func (c *GTSCaches) Start()
Start will attempt to start all of the gtsmodel caches, or panic.
func (*GTSCaches) Status ¶ added in v0.7.0
Status provides access to the gtsmodel Status database cache.
func (*GTSCaches) StatusFave ¶ added in v0.8.0
func (c *GTSCaches) StatusFave() *result.Cache[*gtsmodel.StatusFave]
StatusFave provides access to the gtsmodel StatusFave database cache.
func (*GTSCaches) Stop ¶ added in v0.7.0
func (c *GTSCaches) Stop()
Stop will attempt to stop all of the gtsmodel caches, or panic.
func (*GTSCaches) Tombstone ¶ added in v0.7.0
Tombstone provides access to the gtsmodel Tombstone database cache.
type VisibilityCache ¶ added in v0.8.0
type VisibilityCache struct { *result.Cache[*CachedVisibility] }
func (*VisibilityCache) Init ¶ added in v0.8.0
func (c *VisibilityCache) Init()
Init will initialize the visibility cache in this collection. NOTE: the cache MUST NOT be in use anywhere, this is not thread-safe.
func (*VisibilityCache) Start ¶ added in v0.8.0
func (c *VisibilityCache) Start()
Start will attempt to start the visibility cache, or panic.
func (*VisibilityCache) Stop ¶ added in v0.8.0
func (c *VisibilityCache) Stop()
Stop will attempt to stop the visibility cache, or panic.
type VisibilityType ¶ added in v0.8.0
type VisibilityType byte
VisibilityType represents a visibility lookup type. We use a byte type here to improve performance in the result cache when generating the key.