Documentation ¶
Index ¶
- Constants
- type LocalCacheChannelStore
- func (s LocalCacheChannelStore) ClearCaches()
- func (s LocalCacheChannelStore) Get(id string, allowFromCache bool) (*model.Channel, error)
- func (s LocalCacheChannelStore) GetGuestCount(channelId string, allowFromCache bool) (int64, error)
- func (s LocalCacheChannelStore) GetMemberCount(channelId string, allowFromCache bool) (int64, error)
- func (s LocalCacheChannelStore) GetMemberCountFromCache(channelId string) int64
- func (s LocalCacheChannelStore) GetPinnedPostCount(channelId string, allowFromCache bool) (int64, error)
- func (s LocalCacheChannelStore) InvalidateChannel(channelId string)
- func (s LocalCacheChannelStore) InvalidateGuestCount(channelId string)
- func (s LocalCacheChannelStore) InvalidateMemberCount(channelId string)
- func (s LocalCacheChannelStore) InvalidatePinnedPostCount(channelId string)
- func (s LocalCacheChannelStore) RemoveMember(channelId, userId string) error
- func (s LocalCacheChannelStore) RemoveMembers(channelId string, userIds []string) error
- func (s LocalCacheChannelStore) SaveMember(member *model.ChannelMember) (*model.ChannelMember, error)
- func (s LocalCacheChannelStore) SaveMultipleMembers(members []*model.ChannelMember) ([]*model.ChannelMember, error)
- func (s LocalCacheChannelStore) UpdateMember(member *model.ChannelMember) (*model.ChannelMember, error)
- func (s LocalCacheChannelStore) UpdateMultipleMembers(members []*model.ChannelMember) ([]*model.ChannelMember, error)
- type LocalCacheEmojiStore
- type LocalCacheFileInfoStore
- type LocalCachePostStore
- func (s LocalCachePostStore) ClearCaches()
- func (s LocalCachePostStore) GetEtag(channelId string, allowFromCache, collapsedThreads bool) string
- func (s LocalCachePostStore) GetPosts(options model.GetPostsOptions, allowFromCache bool) (*model.PostList, error)
- func (s LocalCachePostStore) GetPostsSince(options model.GetPostsSinceOptions, allowFromCache bool) (*model.PostList, error)
- func (s LocalCachePostStore) InvalidateLastPostTimeCache(channelId string)
- type LocalCacheReactionStore
- func (s LocalCacheReactionStore) Delete(reaction *model.Reaction) (*model.Reaction, error)
- func (s LocalCacheReactionStore) DeleteAllWithEmojiName(emojiName string) error
- func (s LocalCacheReactionStore) GetForPost(postId string, allowFromCache bool) ([]*model.Reaction, error)
- func (s LocalCacheReactionStore) Save(reaction *model.Reaction) (*model.Reaction, error)
- type LocalCacheRoleStore
- func (s LocalCacheRoleStore) ChannelHigherScopedPermissions(roleNames []string) (map[string]*model.RolePermissions, error)
- func (s LocalCacheRoleStore) Delete(roleId string) (*model.Role, error)
- func (s LocalCacheRoleStore) GetByName(name string) (*model.Role, error)
- func (s LocalCacheRoleStore) GetByNames(names []string) ([]*model.Role, error)
- func (s LocalCacheRoleStore) PermanentDeleteAll() error
- func (s LocalCacheRoleStore) Save(role *model.Role) (*model.Role, error)
- type LocalCacheSchemeStore
- type LocalCacheStore
- func (s LocalCacheStore) Channel() store.ChannelStore
- func (s LocalCacheStore) DropAllTables()
- func (s LocalCacheStore) Emoji() store.EmojiStore
- func (s LocalCacheStore) FileInfo() store.FileInfoStore
- func (s *LocalCacheStore) Invalidate()
- func (s LocalCacheStore) Post() store.PostStore
- func (s LocalCacheStore) Reaction() store.ReactionStore
- func (s LocalCacheStore) Role() store.RoleStore
- func (s LocalCacheStore) Scheme() store.SchemeStore
- func (s LocalCacheStore) Team() store.TeamStore
- func (s LocalCacheStore) TermsOfService() store.TermsOfServiceStore
- func (s LocalCacheStore) User() store.UserStore
- func (s LocalCacheStore) Webhook() store.WebhookStore
- type LocalCacheTeamStore
- type LocalCacheTermsOfServiceStore
- func (s LocalCacheTermsOfServiceStore) ClearCaches()
- func (s LocalCacheTermsOfServiceStore) Get(id string, allowFromCache bool) (*model.TermsOfService, error)
- func (s LocalCacheTermsOfServiceStore) GetLatest(allowFromCache bool) (*model.TermsOfService, error)
- func (s LocalCacheTermsOfServiceStore) Save(termsOfService *model.TermsOfService) (*model.TermsOfService, error)
- type LocalCacheUserStore
- func (s *LocalCacheUserStore) ClearCaches()
- func (s *LocalCacheUserStore) Get(ctx context.Context, id string) (*model.User, error)
- func (s *LocalCacheUserStore) GetAllProfilesInChannel(ctx context.Context, channelId string, allowFromCache bool) (map[string]*model.User, error)
- func (s *LocalCacheUserStore) GetMany(ctx context.Context, ids []string) ([]*model.User, error)
- func (s *LocalCacheUserStore) GetProfileByIds(ctx context.Context, userIds []string, options *store.UserGetByIdsOpts, ...) ([]*model.User, error)
- func (s *LocalCacheUserStore) InvalidateProfileCacheForUser(userId string)
- func (s *LocalCacheUserStore) InvalidateProfilesInChannelCache(channelID string)
- func (s *LocalCacheUserStore) InvalidateProfilesInChannelCacheByUser(userId string)
- type LocalCacheWebhookStore
- func (s LocalCacheWebhookStore) ClearCaches()
- func (s LocalCacheWebhookStore) DeleteIncoming(webhookId string, time int64) error
- func (s LocalCacheWebhookStore) GetIncoming(id string, allowFromCache bool) (*model.IncomingWebhook, error)
- func (s LocalCacheWebhookStore) InvalidateWebhookCache(webhookId string)
- func (s LocalCacheWebhookStore) PermanentDeleteIncomingByChannel(channelId string) error
- func (s LocalCacheWebhookStore) PermanentDeleteIncomingByUser(userId string) error
Constants ¶
View Source
const ( ReactionCacheSize = 20000 ReactionCacheSec = 30 * 60 RoleCacheSize = 20000 RoleCacheSec = 30 * 60 SchemeCacheSize = 20000 SchemeCacheSec = 30 * 60 FileInfoCacheSize = 25000 FileInfoCacheSec = 30 * 60 ChannelGuestCountCacheSize = model.CHANNEL_CACHE_SIZE ChannelGuestCountCacheSec = 30 * 60 WebhookCacheSize = 25000 WebhookCacheSec = 15 * 60 EmojiCacheSize = 5000 EmojiCacheSec = 30 * 60 ChannelPinnedPostsCounsCacheSize = model.CHANNEL_CACHE_SIZE ChannelPinnedPostsCountsCacheSec = 30 * 60 ChannelMembersCountsCacheSize = model.CHANNEL_CACHE_SIZE ChannelMembersCountsCacheSec = 30 * 60 LastPostsCacheSize = 20000 LastPostsCacheSec = 30 * 60 TermsOfServiceCacheSize = 20000 TermsOfServiceCacheSec = 30 * 60 LastPostTimeCacheSize = 25000 LastPostTimeCacheSec = 15 * 60 UserProfileByIDCacheSize = 20000 UserProfileByIDSec = 30 * 60 ProfilesInChannelCacheSize = model.CHANNEL_CACHE_SIZE PROFILES_IN_ChannelCacheSec = 15 * 60 TeamCacheSize = 20000 TeamCacheSec = 30 * 60 ClearCacheMessageData = "" ChannelCacheSec = 15 * 60 // 15 mins )
View Source
const (
LatestKey = "latest"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LocalCacheChannelStore ¶ added in v5.20.0
type LocalCacheChannelStore struct { store.ChannelStore // contains filtered or unexported fields }
func (LocalCacheChannelStore) ClearCaches ¶ added in v5.20.0
func (s LocalCacheChannelStore) ClearCaches()
func (LocalCacheChannelStore) GetGuestCount ¶ added in v5.20.0
func (s LocalCacheChannelStore) GetGuestCount(channelId string, allowFromCache bool) (int64, error)
func (LocalCacheChannelStore) GetMemberCount ¶ added in v5.20.0
func (s LocalCacheChannelStore) GetMemberCount(channelId string, allowFromCache bool) (int64, error)
func (LocalCacheChannelStore) GetMemberCountFromCache ¶ added in v5.20.0
func (s LocalCacheChannelStore) GetMemberCountFromCache(channelId string) int64
func (LocalCacheChannelStore) GetPinnedPostCount ¶ added in v5.20.0
func (s LocalCacheChannelStore) GetPinnedPostCount(channelId string, allowFromCache bool) (int64, error)
func (LocalCacheChannelStore) InvalidateChannel ¶ added in v5.20.0
func (s LocalCacheChannelStore) InvalidateChannel(channelId string)
func (LocalCacheChannelStore) InvalidateGuestCount ¶ added in v5.20.0
func (s LocalCacheChannelStore) InvalidateGuestCount(channelId string)
func (LocalCacheChannelStore) InvalidateMemberCount ¶ added in v5.20.0
func (s LocalCacheChannelStore) InvalidateMemberCount(channelId string)
func (LocalCacheChannelStore) InvalidatePinnedPostCount ¶ added in v5.20.0
func (s LocalCacheChannelStore) InvalidatePinnedPostCount(channelId string)
func (LocalCacheChannelStore) RemoveMember ¶ added in v5.20.0
func (s LocalCacheChannelStore) RemoveMember(channelId, userId string) error
func (LocalCacheChannelStore) RemoveMembers ¶ added in v5.24.0
func (s LocalCacheChannelStore) RemoveMembers(channelId string, userIds []string) error
func (LocalCacheChannelStore) SaveMember ¶ added in v5.20.0
func (s LocalCacheChannelStore) SaveMember(member *model.ChannelMember) (*model.ChannelMember, error)
func (LocalCacheChannelStore) SaveMultipleMembers ¶ added in v5.24.0
func (s LocalCacheChannelStore) SaveMultipleMembers(members []*model.ChannelMember) ([]*model.ChannelMember, error)
func (LocalCacheChannelStore) UpdateMember ¶ added in v5.20.0
func (s LocalCacheChannelStore) UpdateMember(member *model.ChannelMember) (*model.ChannelMember, error)
func (LocalCacheChannelStore) UpdateMultipleMembers ¶ added in v5.24.0
func (s LocalCacheChannelStore) UpdateMultipleMembers(members []*model.ChannelMember) ([]*model.ChannelMember, error)
type LocalCacheEmojiStore ¶ added in v5.20.0
type LocalCacheEmojiStore struct { store.EmojiStore // contains filtered or unexported fields }
func (LocalCacheEmojiStore) Delete ¶ added in v5.20.0
func (es LocalCacheEmojiStore) Delete(emoji *model.Emoji, time int64) error
type LocalCacheFileInfoStore ¶ added in v5.22.0
type LocalCacheFileInfoStore struct { store.FileInfoStore // contains filtered or unexported fields }
func (LocalCacheFileInfoStore) ClearCaches ¶ added in v5.22.0
func (s LocalCacheFileInfoStore) ClearCaches()
func (LocalCacheFileInfoStore) GetForPost ¶ added in v5.22.0
func (LocalCacheFileInfoStore) InvalidateFileInfosForPostCache ¶ added in v5.22.0
func (s LocalCacheFileInfoStore) InvalidateFileInfosForPostCache(postId string, deleted bool)
type LocalCachePostStore ¶ added in v5.20.0
func (LocalCachePostStore) ClearCaches ¶ added in v5.20.0
func (s LocalCachePostStore) ClearCaches()
func (LocalCachePostStore) GetEtag ¶ added in v5.20.0
func (s LocalCachePostStore) GetEtag(channelId string, allowFromCache, collapsedThreads bool) string
func (LocalCachePostStore) GetPosts ¶ added in v5.20.0
func (s LocalCachePostStore) GetPosts(options model.GetPostsOptions, allowFromCache bool) (*model.PostList, error)
func (LocalCachePostStore) GetPostsSince ¶ added in v5.20.0
func (s LocalCachePostStore) GetPostsSince(options model.GetPostsSinceOptions, allowFromCache bool) (*model.PostList, error)
func (LocalCachePostStore) InvalidateLastPostTimeCache ¶ added in v5.20.0
func (s LocalCachePostStore) InvalidateLastPostTimeCache(channelId string)
type LocalCacheReactionStore ¶
type LocalCacheReactionStore struct { store.ReactionStore // contains filtered or unexported fields }
func (LocalCacheReactionStore) DeleteAllWithEmojiName ¶
func (s LocalCacheReactionStore) DeleteAllWithEmojiName(emojiName string) error
func (LocalCacheReactionStore) GetForPost ¶
type LocalCacheRoleStore ¶
func (LocalCacheRoleStore) ChannelHigherScopedPermissions ¶ added in v5.22.0
func (s LocalCacheRoleStore) ChannelHigherScopedPermissions(roleNames []string) (map[string]*model.RolePermissions, error)
func (LocalCacheRoleStore) Delete ¶
func (s LocalCacheRoleStore) Delete(roleId string) (*model.Role, error)
func (LocalCacheRoleStore) GetByName ¶
func (s LocalCacheRoleStore) GetByName(name string) (*model.Role, error)
func (LocalCacheRoleStore) GetByNames ¶
func (s LocalCacheRoleStore) GetByNames(names []string) ([]*model.Role, error)
func (LocalCacheRoleStore) PermanentDeleteAll ¶
func (s LocalCacheRoleStore) PermanentDeleteAll() error
type LocalCacheSchemeStore ¶
type LocalCacheSchemeStore struct { store.SchemeStore // contains filtered or unexported fields }
func (LocalCacheSchemeStore) Delete ¶
func (s LocalCacheSchemeStore) Delete(schemeId string) (*model.Scheme, error)
func (LocalCacheSchemeStore) Get ¶
func (s LocalCacheSchemeStore) Get(schemeId string) (*model.Scheme, error)
func (LocalCacheSchemeStore) PermanentDeleteAll ¶
func (s LocalCacheSchemeStore) PermanentDeleteAll() error
type LocalCacheStore ¶
func NewLocalCacheLayer ¶
func NewLocalCacheLayer(baseStore store.Store, metrics einterfaces.MetricsInterface, cluster einterfaces.ClusterInterface, cacheProvider cache.Provider) (localCacheStore LocalCacheStore, err error)
func (LocalCacheStore) Channel ¶ added in v5.20.0
func (s LocalCacheStore) Channel() store.ChannelStore
func (LocalCacheStore) DropAllTables ¶
func (s LocalCacheStore) DropAllTables()
func (LocalCacheStore) Emoji ¶ added in v5.20.0
func (s LocalCacheStore) Emoji() store.EmojiStore
func (LocalCacheStore) FileInfo ¶ added in v5.22.0
func (s LocalCacheStore) FileInfo() store.FileInfoStore
func (*LocalCacheStore) Invalidate ¶
func (s *LocalCacheStore) Invalidate()
func (LocalCacheStore) Post ¶ added in v5.20.0
func (s LocalCacheStore) Post() store.PostStore
func (LocalCacheStore) Reaction ¶
func (s LocalCacheStore) Reaction() store.ReactionStore
func (LocalCacheStore) Role ¶
func (s LocalCacheStore) Role() store.RoleStore
func (LocalCacheStore) Scheme ¶
func (s LocalCacheStore) Scheme() store.SchemeStore
func (LocalCacheStore) Team ¶ added in v5.20.0
func (s LocalCacheStore) Team() store.TeamStore
func (LocalCacheStore) TermsOfService ¶ added in v5.20.0
func (s LocalCacheStore) TermsOfService() store.TermsOfServiceStore
func (LocalCacheStore) User ¶ added in v5.20.0
func (s LocalCacheStore) User() store.UserStore
func (LocalCacheStore) Webhook ¶ added in v5.20.0
func (s LocalCacheStore) Webhook() store.WebhookStore
type LocalCacheTeamStore ¶ added in v5.20.0
func (LocalCacheTeamStore) ClearCaches ¶ added in v5.20.0
func (s LocalCacheTeamStore) ClearCaches()
func (LocalCacheTeamStore) GetUserTeamIds ¶ added in v5.20.0
func (s LocalCacheTeamStore) GetUserTeamIds(userID string, allowFromCache bool) ([]string, error)
func (LocalCacheTeamStore) InvalidateAllTeamIdsForUser ¶ added in v5.20.0
func (s LocalCacheTeamStore) InvalidateAllTeamIdsForUser(userId string)
type LocalCacheTermsOfServiceStore ¶ added in v5.20.0
type LocalCacheTermsOfServiceStore struct { store.TermsOfServiceStore // contains filtered or unexported fields }
func (LocalCacheTermsOfServiceStore) ClearCaches ¶ added in v5.20.0
func (s LocalCacheTermsOfServiceStore) ClearCaches()
func (LocalCacheTermsOfServiceStore) Get ¶ added in v5.20.0
func (s LocalCacheTermsOfServiceStore) Get(id string, allowFromCache bool) (*model.TermsOfService, error)
func (LocalCacheTermsOfServiceStore) GetLatest ¶ added in v5.20.0
func (s LocalCacheTermsOfServiceStore) GetLatest(allowFromCache bool) (*model.TermsOfService, error)
func (LocalCacheTermsOfServiceStore) Save ¶ added in v5.20.0
func (s LocalCacheTermsOfServiceStore) Save(termsOfService *model.TermsOfService) (*model.TermsOfService, error)
type LocalCacheUserStore ¶ added in v5.20.0
func (*LocalCacheUserStore) ClearCaches ¶ added in v5.20.0
func (s *LocalCacheUserStore) ClearCaches()
func (*LocalCacheUserStore) Get ¶ added in v5.24.0
Get is a cache wrapper around the SqlStore method to get a user profile by id. It checks if the user entry is present in the cache, returning the entry from cache if it is present. Otherwise, it fetches the entry from the store and stores it in the cache.
func (*LocalCacheUserStore) GetAllProfilesInChannel ¶ added in v5.20.0
func (*LocalCacheUserStore) GetMany ¶ added in v5.33.0
GetMany is a cache wrapper around the SqlStore method to get a user profiles by ids. It checks if the user entries are present in the cache, returning the entries from cache if it is present. Otherwise, it fetches the entries from the store and stores it in the cache.
func (*LocalCacheUserStore) GetProfileByIds ¶ added in v5.20.0
func (s *LocalCacheUserStore) GetProfileByIds(ctx context.Context, userIds []string, options *store.UserGetByIdsOpts, allowFromCache bool) ([]*model.User, error)
func (*LocalCacheUserStore) InvalidateProfileCacheForUser ¶ added in v5.20.0
func (s *LocalCacheUserStore) InvalidateProfileCacheForUser(userId string)
func (*LocalCacheUserStore) InvalidateProfilesInChannelCache ¶ added in v5.20.0
func (s *LocalCacheUserStore) InvalidateProfilesInChannelCache(channelID string)
func (*LocalCacheUserStore) InvalidateProfilesInChannelCacheByUser ¶ added in v5.20.0
func (s *LocalCacheUserStore) InvalidateProfilesInChannelCacheByUser(userId string)
type LocalCacheWebhookStore ¶ added in v5.20.0
type LocalCacheWebhookStore struct { store.WebhookStore // contains filtered or unexported fields }
func (LocalCacheWebhookStore) ClearCaches ¶ added in v5.20.0
func (s LocalCacheWebhookStore) ClearCaches()
func (LocalCacheWebhookStore) DeleteIncoming ¶ added in v5.20.0
func (s LocalCacheWebhookStore) DeleteIncoming(webhookId string, time int64) error
func (LocalCacheWebhookStore) GetIncoming ¶ added in v5.20.0
func (s LocalCacheWebhookStore) GetIncoming(id string, allowFromCache bool) (*model.IncomingWebhook, error)
func (LocalCacheWebhookStore) InvalidateWebhookCache ¶ added in v5.20.0
func (s LocalCacheWebhookStore) InvalidateWebhookCache(webhookId string)
func (LocalCacheWebhookStore) PermanentDeleteIncomingByChannel ¶ added in v5.20.0
func (s LocalCacheWebhookStore) PermanentDeleteIncomingByChannel(channelId string) error
func (LocalCacheWebhookStore) PermanentDeleteIncomingByUser ¶ added in v5.20.0
func (s LocalCacheWebhookStore) PermanentDeleteIncomingByUser(userId string) error
Click to show internal directories.
Click to hide internal directories.