localcachelayer

package
v5.3.2-0...-ccc9e37 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2020 License: AGPL-3.0, Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	REACTION_CACHE_SIZE = 20000
	REACTION_CACHE_SEC  = 30 * 60

	ROLE_CACHE_SIZE = 20000
	ROLE_CACHE_SEC  = 30 * 60

	SCHEME_CACHE_SIZE = 20000
	SCHEME_CACHE_SEC  = 30 * 60

	FILE_INFO_CACHE_SIZE = 25000
	FILE_INFO_CACHE_SEC  = 30 * 60

	CHANNEL_GUEST_COUNT_CACHE_SIZE = model.CHANNEL_CACHE_SIZE
	CHANNEL_GUEST_COUNT_CACHE_SEC  = 30 * 60

	WEBHOOK_CACHE_SIZE = 25000
	WEBHOOK_CACHE_SEC  = 15 * 60

	EMOJI_CACHE_SIZE = 5000
	EMOJI_CACHE_SEC  = 30 * 60

	CHANNEL_PINNEDPOSTS_COUNTS_CACHE_SIZE = model.CHANNEL_CACHE_SIZE
	CHANNEL_PINNEDPOSTS_COUNTS_CACHE_SEC  = 30 * 60

	CHANNEL_MEMBERS_COUNTS_CACHE_SIZE = model.CHANNEL_CACHE_SIZE
	CHANNEL_MEMBERS_COUNTS_CACHE_SEC  = 30 * 60

	LAST_POSTS_CACHE_SIZE = 20000
	LAST_POSTS_CACHE_SEC  = 30 * 60

	TERMS_OF_SERVICE_CACHE_SIZE = 20000
	TERMS_OF_SERVICE_CACHE_SEC  = 30 * 60
	LAST_POST_TIME_CACHE_SIZE   = 25000
	LAST_POST_TIME_CACHE_SEC    = 15 * 60

	USER_PROFILE_BY_ID_CACHE_SIZE = 20000
	USER_PROFILE_BY_ID_SEC        = 30 * 60

	PROFILES_IN_CHANNEL_CACHE_SIZE = model.CHANNEL_CACHE_SIZE
	PROFILES_IN_CHANNEL_CACHE_SEC  = 15 * 60

	TEAM_CACHE_SIZE = 20000
	TEAM_CACHE_SEC  = 30 * 60

	CLEAR_CACHE_MESSAGE_DATA = ""

	CHANNEL_CACHE_SEC = 15 * 60 // 15 mins
)
View Source
const (
	LATEST_KEY = "latest"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalCacheChannelStore

type LocalCacheChannelStore struct {
	store.ChannelStore
	// contains filtered or unexported fields
}

func (LocalCacheChannelStore) ClearCaches

func (s LocalCacheChannelStore) ClearCaches()

func (LocalCacheChannelStore) Get

func (s LocalCacheChannelStore) Get(id string, allowFromCache bool) (*model.Channel, error)

func (LocalCacheChannelStore) GetGuestCount

func (s LocalCacheChannelStore) GetGuestCount(channelId string, allowFromCache bool) (int64, error)

func (LocalCacheChannelStore) GetMemberCount

func (s LocalCacheChannelStore) GetMemberCount(channelId string, allowFromCache bool) (int64, error)

func (LocalCacheChannelStore) GetMemberCountFromCache

func (s LocalCacheChannelStore) GetMemberCountFromCache(channelId string) int64

func (LocalCacheChannelStore) GetPinnedPostCount

func (s LocalCacheChannelStore) GetPinnedPostCount(channelId string, allowFromCache bool) (int64, error)

func (LocalCacheChannelStore) InvalidateChannel

func (s LocalCacheChannelStore) InvalidateChannel(channelId string)

func (LocalCacheChannelStore) InvalidateGuestCount

func (s LocalCacheChannelStore) InvalidateGuestCount(channelId string)

func (LocalCacheChannelStore) InvalidateMemberCount

func (s LocalCacheChannelStore) InvalidateMemberCount(channelId string)

func (LocalCacheChannelStore) InvalidatePinnedPostCount

func (s LocalCacheChannelStore) InvalidatePinnedPostCount(channelId string)

func (LocalCacheChannelStore) RemoveMember

func (s LocalCacheChannelStore) RemoveMember(channelId, userId string) error

func (LocalCacheChannelStore) RemoveMembers

func (s LocalCacheChannelStore) RemoveMembers(channelId string, userIds []string) error

func (LocalCacheChannelStore) SaveMember

func (LocalCacheChannelStore) SaveMultipleMembers

func (s LocalCacheChannelStore) SaveMultipleMembers(members []*model.ChannelMember) ([]*model.ChannelMember, error)

func (LocalCacheChannelStore) UpdateMember

func (s LocalCacheChannelStore) UpdateMember(member *model.ChannelMember) (*model.ChannelMember, error)

func (LocalCacheChannelStore) UpdateMultipleMembers

func (s LocalCacheChannelStore) UpdateMultipleMembers(members []*model.ChannelMember) ([]*model.ChannelMember, error)

type LocalCacheEmojiStore

type LocalCacheEmojiStore struct {
	store.EmojiStore
	// contains filtered or unexported fields
}

func (LocalCacheEmojiStore) Delete

func (es LocalCacheEmojiStore) Delete(emoji *model.Emoji, time int64) error

func (LocalCacheEmojiStore) Get

func (es LocalCacheEmojiStore) Get(id string, allowFromCache bool) (*model.Emoji, error)

func (LocalCacheEmojiStore) GetByName

func (es LocalCacheEmojiStore) GetByName(name string, allowFromCache bool) (*model.Emoji, error)

type LocalCacheFileInfoStore

type LocalCacheFileInfoStore struct {
	store.FileInfoStore
	// contains filtered or unexported fields
}

func (LocalCacheFileInfoStore) ClearCaches

func (s LocalCacheFileInfoStore) ClearCaches()

func (LocalCacheFileInfoStore) GetForPost

func (s LocalCacheFileInfoStore) GetForPost(postId string, readFromMaster, includeDeleted, allowFromCache bool) ([]*model.FileInfo, error)

func (LocalCacheFileInfoStore) InvalidateFileInfosForPostCache

func (s LocalCacheFileInfoStore) InvalidateFileInfosForPostCache(postId string, deleted bool)

type LocalCachePostStore

type LocalCachePostStore struct {
	store.PostStore
	// contains filtered or unexported fields
}

func (LocalCachePostStore) ClearCaches

func (s LocalCachePostStore) ClearCaches()

func (LocalCachePostStore) GetEtag

func (s LocalCachePostStore) GetEtag(channelId string, allowFromCache bool) string

func (LocalCachePostStore) GetPosts

func (s LocalCachePostStore) GetPosts(options model.GetPostsOptions, allowFromCache bool) (*model.PostList, error)

func (LocalCachePostStore) GetPostsSince

func (s LocalCachePostStore) GetPostsSince(options model.GetPostsSinceOptions, allowFromCache bool) (*model.PostList, error)

func (LocalCachePostStore) InvalidateLastPostTimeCache

func (s LocalCachePostStore) InvalidateLastPostTimeCache(channelId string)

type LocalCacheReactionStore

type LocalCacheReactionStore struct {
	store.ReactionStore
	// contains filtered or unexported fields
}

func (LocalCacheReactionStore) Delete

func (s LocalCacheReactionStore) Delete(reaction *model.Reaction) (*model.Reaction, error)

func (LocalCacheReactionStore) DeleteAllWithEmojiName

func (s LocalCacheReactionStore) DeleteAllWithEmojiName(emojiName string) error

func (LocalCacheReactionStore) GetForPost

func (s LocalCacheReactionStore) GetForPost(postId string, allowFromCache bool) ([]*model.Reaction, error)

func (LocalCacheReactionStore) Save

func (s LocalCacheReactionStore) Save(reaction *model.Reaction) (*model.Reaction, error)

type LocalCacheRoleStore

type LocalCacheRoleStore struct {
	store.RoleStore
	// contains filtered or unexported fields
}

func (LocalCacheRoleStore) ChannelHigherScopedPermissions

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

func (LocalCacheRoleStore) Save

func (s LocalCacheRoleStore) Save(role *model.Role) (*model.Role, 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

func (LocalCacheSchemeStore) Save

func (s LocalCacheSchemeStore) Save(scheme *model.Scheme) (*model.Scheme, error)

type LocalCacheStore

type LocalCacheStore struct {
	store.Store
	// contains filtered or unexported fields
}

func NewLocalCacheLayer

func NewLocalCacheLayer(baseStore store.Store, metrics einterfaces.MetricsInterface, cluster einterfaces.ClusterInterface, cacheProvider cache.Provider) LocalCacheStore

func (LocalCacheStore) Channel

func (s LocalCacheStore) Channel() store.ChannelStore

func (LocalCacheStore) DropAllTables

func (s LocalCacheStore) DropAllTables()

func (LocalCacheStore) Emoji

func (s LocalCacheStore) Emoji() store.EmojiStore

func (LocalCacheStore) FileInfo

func (s LocalCacheStore) FileInfo() store.FileInfoStore

func (*LocalCacheStore) Invalidate

func (s *LocalCacheStore) Invalidate()

func (LocalCacheStore) Post

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

func (s LocalCacheStore) Team() store.TeamStore

func (LocalCacheStore) TermsOfService

func (s LocalCacheStore) TermsOfService() store.TermsOfServiceStore

func (LocalCacheStore) User

func (s LocalCacheStore) User() store.UserStore

func (LocalCacheStore) Webhook

func (s LocalCacheStore) Webhook() store.WebhookStore

type LocalCacheTeamStore

type LocalCacheTeamStore struct {
	store.TeamStore
	// contains filtered or unexported fields
}

func (LocalCacheTeamStore) ClearCaches

func (s LocalCacheTeamStore) ClearCaches()

func (LocalCacheTeamStore) GetUserTeamIds

func (s LocalCacheTeamStore) GetUserTeamIds(userID string, allowFromCache bool) ([]string, error)

func (LocalCacheTeamStore) InvalidateAllTeamIdsForUser

func (s LocalCacheTeamStore) InvalidateAllTeamIdsForUser(userId string)

func (LocalCacheTeamStore) Update

func (s LocalCacheTeamStore) Update(team *model.Team) (*model.Team, error)

type LocalCacheTermsOfServiceStore

type LocalCacheTermsOfServiceStore struct {
	store.TermsOfServiceStore
	// contains filtered or unexported fields
}

func (LocalCacheTermsOfServiceStore) ClearCaches

func (s LocalCacheTermsOfServiceStore) ClearCaches()

func (LocalCacheTermsOfServiceStore) Get

func (s LocalCacheTermsOfServiceStore) Get(id string, allowFromCache bool) (*model.TermsOfService, error)

func (LocalCacheTermsOfServiceStore) GetLatest

func (s LocalCacheTermsOfServiceStore) GetLatest(allowFromCache bool) (*model.TermsOfService, error)

func (LocalCacheTermsOfServiceStore) Save

type LocalCacheUserStore

type LocalCacheUserStore struct {
	store.UserStore
	// contains filtered or unexported fields
}

func (LocalCacheUserStore) ClearCaches

func (s LocalCacheUserStore) ClearCaches()

func (LocalCacheUserStore) Get

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

func (s LocalCacheUserStore) GetAllProfilesInChannel(channelId string, allowFromCache bool) (map[string]*model.User, *model.AppError)

func (LocalCacheUserStore) GetProfileByIds

func (s LocalCacheUserStore) GetProfileByIds(userIds []string, options *store.UserGetByIdsOpts, allowFromCache bool) ([]*model.User, *model.AppError)

func (LocalCacheUserStore) InvalidateProfileCacheForUser

func (s LocalCacheUserStore) InvalidateProfileCacheForUser(userId string)

func (LocalCacheUserStore) InvalidateProfilesInChannelCache

func (s LocalCacheUserStore) InvalidateProfilesInChannelCache(channelId string)

func (LocalCacheUserStore) InvalidateProfilesInChannelCacheByUser

func (s LocalCacheUserStore) InvalidateProfilesInChannelCacheByUser(userId string)

type LocalCacheWebhookStore

type LocalCacheWebhookStore struct {
	store.WebhookStore
	// contains filtered or unexported fields
}

func (LocalCacheWebhookStore) ClearCaches

func (s LocalCacheWebhookStore) ClearCaches()

func (LocalCacheWebhookStore) DeleteIncoming

func (s LocalCacheWebhookStore) DeleteIncoming(webhookId string, time int64) error

func (LocalCacheWebhookStore) GetIncoming

func (s LocalCacheWebhookStore) GetIncoming(id string, allowFromCache bool) (*model.IncomingWebhook, error)

func (LocalCacheWebhookStore) InvalidateWebhookCache

func (s LocalCacheWebhookStore) InvalidateWebhookCache(webhookId string)

func (LocalCacheWebhookStore) PermanentDeleteIncomingByChannel

func (s LocalCacheWebhookStore) PermanentDeleteIncomingByChannel(channelId string) error

func (LocalCacheWebhookStore) PermanentDeleteIncomingByUser

func (s LocalCacheWebhookStore) PermanentDeleteIncomingByUser(userId string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL