2016-02-04 13:00:03 -05:00
|
|
|
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
|
2015-06-14 23:53:32 -08:00
|
|
|
// See License.txt for license information.
|
|
|
|
|
|
|
|
|
|
package store
|
|
|
|
|
|
|
|
|
|
import (
|
2016-09-06 18:51:27 -04:00
|
|
|
"time"
|
|
|
|
|
|
2016-01-11 09:12:51 -06:00
|
|
|
l4g "github.com/alecthomas/log4go"
|
2015-06-14 23:53:32 -08:00
|
|
|
"github.com/mattermost/platform/model"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type StoreResult struct {
|
|
|
|
|
Data interface{}
|
|
|
|
|
Err *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type StoreChannel chan StoreResult
|
|
|
|
|
|
2015-07-06 00:50:42 -08:00
|
|
|
func Must(sc StoreChannel) interface{} {
|
|
|
|
|
r := <-sc
|
|
|
|
|
if r.Err != nil {
|
2015-08-20 14:20:39 -07:00
|
|
|
l4g.Close()
|
|
|
|
|
time.Sleep(time.Second)
|
2015-07-06 00:50:42 -08:00
|
|
|
panic(r.Err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r.Data
|
|
|
|
|
}
|
|
|
|
|
|
2015-06-14 23:53:32 -08:00
|
|
|
type Store interface {
|
|
|
|
|
Team() TeamStore
|
|
|
|
|
Channel() ChannelStore
|
|
|
|
|
Post() PostStore
|
|
|
|
|
User() UserStore
|
|
|
|
|
Audit() AuditStore
|
2016-03-14 16:07:58 -07:00
|
|
|
Compliance() ComplianceStore
|
2015-06-14 23:53:32 -08:00
|
|
|
Session() SessionStore
|
2015-09-16 15:49:12 -04:00
|
|
|
OAuth() OAuthStore
|
2015-09-16 19:59:57 -07:00
|
|
|
System() SystemStore
|
2015-09-21 14:22:23 -04:00
|
|
|
Webhook() WebhookStore
|
2016-01-06 21:09:05 -06:00
|
|
|
Command() CommandStore
|
2015-10-01 10:56:07 -04:00
|
|
|
Preference() PreferenceStore
|
2016-02-04 13:00:03 -05:00
|
|
|
License() LicenseStore
|
2016-04-21 22:37:01 -07:00
|
|
|
PasswordRecovery() PasswordRecoveryStore
|
2016-06-14 09:38:19 -04:00
|
|
|
Emoji() EmojiStore
|
2016-07-18 11:10:03 -04:00
|
|
|
Status() StatusStore
|
2016-09-30 11:06:30 -04:00
|
|
|
FileInfo() FileInfoStore
|
2016-11-30 13:55:49 -05:00
|
|
|
Reaction() ReactionStore
|
2015-10-15 11:16:26 -07:00
|
|
|
MarkSystemRanUnitTests()
|
2015-06-14 23:53:32 -08:00
|
|
|
Close()
|
2016-04-21 22:37:01 -07:00
|
|
|
DropAllTables()
|
2016-10-19 14:49:25 -04:00
|
|
|
TotalMasterDbConnections() int
|
|
|
|
|
TotalReadDbConnections() int
|
2015-06-14 23:53:32 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type TeamStore interface {
|
2016-01-20 13:36:16 -06:00
|
|
|
Save(team *model.Team) StoreChannel
|
|
|
|
|
Update(team *model.Team) StoreChannel
|
|
|
|
|
UpdateDisplayName(name string, teamId string) StoreChannel
|
|
|
|
|
Get(id string) StoreChannel
|
|
|
|
|
GetByName(name string) StoreChannel
|
2017-02-02 11:46:42 -05:00
|
|
|
SearchByName(name string) StoreChannel
|
2017-04-04 02:34:14 +09:00
|
|
|
SearchAll(term string) StoreChannel
|
|
|
|
|
SearchOpen(term string) StoreChannel
|
2016-01-20 13:36:16 -06:00
|
|
|
GetAll() StoreChannel
|
2017-02-28 10:41:38 +02:00
|
|
|
GetAllPage(offset int, limit int) StoreChannel
|
2016-01-20 13:36:16 -06:00
|
|
|
GetAllTeamListing() StoreChannel
|
2017-02-28 10:41:38 +02:00
|
|
|
GetAllTeamPageListing(offset int, limit int) StoreChannel
|
2016-04-21 22:37:01 -07:00
|
|
|
GetTeamsByUserId(userId string) StoreChannel
|
2016-01-20 13:36:16 -06:00
|
|
|
GetByInviteId(inviteId string) StoreChannel
|
|
|
|
|
PermanentDelete(teamId string) StoreChannel
|
2016-02-25 12:32:46 -05:00
|
|
|
AnalyticsTeamCount() StoreChannel
|
2016-04-21 22:37:01 -07:00
|
|
|
SaveMember(member *model.TeamMember) StoreChannel
|
|
|
|
|
UpdateMember(member *model.TeamMember) StoreChannel
|
2016-05-16 12:55:22 -04:00
|
|
|
GetMember(teamId string, userId string) StoreChannel
|
2016-10-19 14:49:25 -04:00
|
|
|
GetMembers(teamId string, offset int, limit int) StoreChannel
|
|
|
|
|
GetMembersByIds(teamId string, userIds []string) StoreChannel
|
2016-11-04 12:27:19 -04:00
|
|
|
GetTotalMemberCount(teamId string) StoreChannel
|
|
|
|
|
GetActiveMemberCount(teamId string) StoreChannel
|
2016-04-21 22:37:01 -07:00
|
|
|
GetTeamsForUser(userId string) StoreChannel
|
2017-03-13 09:46:28 -04:00
|
|
|
GetChannelUnreadsForAllTeams(excludeTeamId, userId string) StoreChannel
|
|
|
|
|
GetChannelUnreadsForTeam(teamId, userId string) StoreChannel
|
2016-04-21 22:37:01 -07:00
|
|
|
RemoveMember(teamId string, userId string) StoreChannel
|
|
|
|
|
RemoveAllMembersByTeam(teamId string) StoreChannel
|
|
|
|
|
RemoveAllMembersByUser(userId string) StoreChannel
|
2015-06-14 23:53:32 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ChannelStore interface {
|
2016-01-20 13:36:16 -06:00
|
|
|
Save(channel *model.Channel) StoreChannel
|
2016-10-17 15:12:56 +03:00
|
|
|
CreateDirectChannel(userId string, otherUserId string) StoreChannel
|
2016-01-20 13:36:16 -06:00
|
|
|
SaveDirectChannel(channel *model.Channel, member1 *model.ChannelMember, member2 *model.ChannelMember) StoreChannel
|
|
|
|
|
Update(channel *model.Channel) StoreChannel
|
2017-01-03 09:53:59 -05:00
|
|
|
Get(id string, allowFromCache bool) StoreChannel
|
|
|
|
|
InvalidateChannel(id string)
|
2017-01-27 14:07:34 -05:00
|
|
|
InvalidateChannelByName(teamId, name string)
|
2016-01-20 13:36:16 -06:00
|
|
|
GetFromMaster(id string) StoreChannel
|
|
|
|
|
Delete(channelId string, time int64) StoreChannel
|
2016-07-06 10:11:21 -08:00
|
|
|
SetDeleteAt(channelId string, deleteAt int64, updateAt int64) StoreChannel
|
2016-01-20 13:36:16 -06:00
|
|
|
PermanentDeleteByTeam(teamId string) StoreChannel
|
2017-02-02 11:46:42 -05:00
|
|
|
PermanentDelete(channelId string) StoreChannel
|
2017-01-27 14:07:34 -05:00
|
|
|
GetByName(team_id string, name string, allowFromCache bool) StoreChannel
|
|
|
|
|
GetByNameIncludeDeleted(team_id string, name string, allowFromCache bool) StoreChannel
|
2017-01-26 02:14:12 +00:00
|
|
|
GetDeletedByName(team_id string, name string) StoreChannel
|
2016-01-20 13:36:16 -06:00
|
|
|
GetChannels(teamId string, userId string) StoreChannel
|
2016-11-24 09:35:09 -05:00
|
|
|
GetMoreChannels(teamId string, userId string, offset int, limit int) StoreChannel
|
2017-03-13 21:26:51 +09:00
|
|
|
GetPublicChannelsForTeam(teamId string, offset int, limit int) StoreChannel
|
2017-03-27 20:41:40 +09:00
|
|
|
GetPublicChannelsByIdsForTeam(teamId string, channelIds []string) StoreChannel
|
2016-01-20 13:36:16 -06:00
|
|
|
GetChannelCounts(teamId string, userId string) StoreChannel
|
2016-11-10 11:23:55 -03:00
|
|
|
GetTeamChannels(teamId string) StoreChannel
|
2016-07-06 10:11:21 -08:00
|
|
|
GetAll(teamId string) StoreChannel
|
2016-09-30 11:06:30 -04:00
|
|
|
GetForPost(postId string) StoreChannel
|
2016-01-20 13:36:16 -06:00
|
|
|
SaveMember(member *model.ChannelMember) StoreChannel
|
|
|
|
|
UpdateMember(member *model.ChannelMember) StoreChannel
|
2017-02-07 14:58:27 -08:00
|
|
|
GetMembers(channelId string, offset, limit int) StoreChannel
|
2017-02-27 17:43:23 -05:00
|
|
|
GetMember(channelId string, userId string) StoreChannel
|
2016-10-19 14:49:25 -04:00
|
|
|
GetAllChannelMembersForUser(userId string, allowFromCache bool) StoreChannel
|
|
|
|
|
InvalidateAllChannelMembersForUser(userId string)
|
|
|
|
|
IsUserInChannelUseCache(userId string, channelId string) bool
|
2017-02-23 11:08:48 -03:00
|
|
|
GetAllChannelMembersNotifyPropsForChannel(channelId string, allowFromCache bool) StoreChannel
|
|
|
|
|
InvalidateCacheForChannelMembersNotifyProps(channelId string)
|
2016-09-30 11:06:30 -04:00
|
|
|
GetMemberForPost(postId string, userId string) StoreChannel
|
2016-11-24 05:26:45 -08:00
|
|
|
InvalidateMemberCount(channelId string)
|
2017-01-03 11:45:45 -05:00
|
|
|
GetMemberCountFromCache(channelId string) int64
|
2016-11-24 05:26:45 -08:00
|
|
|
GetMemberCount(channelId string, allowFromCache bool) StoreChannel
|
2017-03-13 13:25:08 +01:00
|
|
|
GetPinnedPosts(channelId string) StoreChannel
|
2016-01-20 13:36:16 -06:00
|
|
|
RemoveMember(channelId string, userId string) StoreChannel
|
|
|
|
|
PermanentDeleteMembersByUser(userId string) StoreChannel
|
2017-02-02 11:46:42 -05:00
|
|
|
PermanentDeleteMembersByChannel(channelId string) StoreChannel
|
2016-12-23 10:32:30 -05:00
|
|
|
UpdateLastViewedAt(channelIds []string, userId string) StoreChannel
|
2016-01-20 13:36:16 -06:00
|
|
|
IncrementMentionCount(channelId string, userId string) StoreChannel
|
|
|
|
|
AnalyticsTypeCount(teamId string, channelType string) StoreChannel
|
2016-02-25 04:24:03 -03:00
|
|
|
ExtraUpdateByUser(userId string, time int64) StoreChannel
|
2016-10-27 12:24:30 -03:00
|
|
|
GetMembersForUser(teamId string, userId string) StoreChannel
|
2016-11-24 09:35:09 -05:00
|
|
|
SearchInTeam(teamId string, term string) StoreChannel
|
|
|
|
|
SearchMore(userId string, teamId string, term string) StoreChannel
|
2016-12-22 18:21:05 +00:00
|
|
|
GetMembersByIds(channelId string, userIds []string) StoreChannel
|
2017-02-24 17:33:59 +00:00
|
|
|
AnalyticsDeletedTypeCount(teamId string, channelType string) StoreChannel
|
2017-03-16 14:58:33 -04:00
|
|
|
GetChannelUnread(channelId, userId string) StoreChannel
|
2015-06-14 23:53:32 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type PostStore interface {
|
2016-01-20 13:36:16 -06:00
|
|
|
Save(post *model.Post) StoreChannel
|
2016-09-30 11:06:30 -04:00
|
|
|
Update(newPost *model.Post, oldPost *model.Post) StoreChannel
|
2016-01-20 13:36:16 -06:00
|
|
|
Get(id string) StoreChannel
|
2017-01-25 09:32:42 -05:00
|
|
|
GetSingle(id string) StoreChannel
|
2016-01-20 13:36:16 -06:00
|
|
|
Delete(postId string, time int64) StoreChannel
|
|
|
|
|
PermanentDeleteByUser(userId string) StoreChannel
|
2017-02-02 11:46:42 -05:00
|
|
|
PermanentDeleteByChannel(channelId string) StoreChannel
|
2016-12-22 18:14:54 -05:00
|
|
|
GetPosts(channelId string, offset int, limit int, allowFromCache bool) StoreChannel
|
2016-08-04 11:38:09 -04:00
|
|
|
GetFlaggedPosts(userId string, offset int, limit int) StoreChannel
|
2017-03-31 12:25:39 -04:00
|
|
|
GetFlaggedPostsForTeam(userId, teamId string, offset int, limit int) StoreChannel
|
2017-04-06 05:18:23 +09:00
|
|
|
GetFlaggedPostsForChannel(userId, channelId string, offset int, limit int) StoreChannel
|
2016-01-20 13:36:16 -06:00
|
|
|
GetPostsBefore(channelId string, postId string, numPosts int, offset int) StoreChannel
|
|
|
|
|
GetPostsAfter(channelId string, postId string, numPosts int, offset int) StoreChannel
|
2016-12-20 09:41:04 -05:00
|
|
|
GetPostsSince(channelId string, time int64, allowFromCache bool) StoreChannel
|
2016-12-13 22:24:24 -05:00
|
|
|
GetEtag(channelId string, allowFromCache bool) StoreChannel
|
2016-01-20 13:36:16 -06:00
|
|
|
Search(teamId string, userId string, params *model.SearchParams) StoreChannel
|
|
|
|
|
AnalyticsUserCountsWithPostsByDay(teamId string) StoreChannel
|
|
|
|
|
AnalyticsPostCountsByDay(teamId string) StoreChannel
|
2016-02-02 08:41:02 -05:00
|
|
|
AnalyticsPostCount(teamId string, mustHaveFile bool, mustHaveHashtag bool) StoreChannel
|
2016-12-20 09:41:04 -05:00
|
|
|
InvalidateLastPostTimeCache(channelId string)
|
2017-02-28 23:55:21 +00:00
|
|
|
GetPostsCreatedAt(channelId string, time int64) StoreChannel
|
|
|
|
|
Overwrite(post *model.Post) StoreChannel
|
2015-06-14 23:53:32 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type UserStore interface {
|
2016-01-20 13:36:16 -06:00
|
|
|
Save(user *model.User) StoreChannel
|
|
|
|
|
Update(user *model.User, allowRoleUpdate bool) StoreChannel
|
|
|
|
|
UpdateLastPictureUpdate(userId string) StoreChannel
|
2016-05-12 18:36:30 -07:00
|
|
|
UpdateUpdateAt(userId string) StoreChannel
|
2016-01-20 13:36:16 -06:00
|
|
|
UpdatePassword(userId, newPassword string) StoreChannel
|
2016-12-12 08:16:10 -05:00
|
|
|
UpdateAuthData(userId string, service string, authData *string, email string, resetMfa bool) StoreChannel
|
2016-03-30 12:49:29 -04:00
|
|
|
UpdateMfaSecret(userId, secret string) StoreChannel
|
|
|
|
|
UpdateMfaActive(userId string, active bool) StoreChannel
|
2016-01-20 13:36:16 -06:00
|
|
|
Get(id string) StoreChannel
|
2016-04-21 22:37:01 -07:00
|
|
|
GetAll() StoreChannel
|
2016-11-10 06:25:23 -08:00
|
|
|
InvalidateProfilesInChannelCacheByUser(userId string)
|
2016-10-19 14:49:25 -04:00
|
|
|
InvalidateProfilesInChannelCache(channelId string)
|
2017-02-03 15:17:34 -05:00
|
|
|
GetProfilesInChannel(channelId string, offset int, limit int) StoreChannel
|
|
|
|
|
GetAllProfilesInChannel(channelId string, allowFromCache bool) StoreChannel
|
2016-10-19 14:49:25 -04:00
|
|
|
GetProfilesNotInChannel(teamId string, channelId string, offset int, limit int) StoreChannel
|
2017-03-29 21:11:40 -04:00
|
|
|
GetProfilesWithoutTeam(offset int, limit int) StoreChannel
|
2016-10-19 14:49:25 -04:00
|
|
|
GetProfilesByUsernames(usernames []string, teamId string) StoreChannel
|
|
|
|
|
GetAllProfiles(offset int, limit int) StoreChannel
|
|
|
|
|
GetProfiles(teamId string, offset int, limit int) StoreChannel
|
2016-12-13 19:23:36 -08:00
|
|
|
GetProfileByIds(userId []string, allowFromCache bool) StoreChannel
|
|
|
|
|
InvalidatProfileCacheForUser(userId string)
|
2016-04-21 22:37:01 -07:00
|
|
|
GetByEmail(email string) StoreChannel
|
2016-05-11 11:04:30 -07:00
|
|
|
GetByAuth(authData *string, authService string) StoreChannel
|
2016-06-03 09:33:59 -04:00
|
|
|
GetAllUsingAuthService(authService string) StoreChannel
|
2016-04-21 22:37:01 -07:00
|
|
|
GetByUsername(username string) StoreChannel
|
2016-05-03 14:10:36 -04:00
|
|
|
GetForLogin(loginId string, allowSignInWithUsername, allowSignInWithEmail, ldapEnabled bool) StoreChannel
|
2016-01-20 13:36:16 -06:00
|
|
|
VerifyEmail(userId string) StoreChannel
|
2016-05-04 06:31:42 -07:00
|
|
|
GetEtagForAllProfiles() StoreChannel
|
2016-01-20 13:36:16 -06:00
|
|
|
GetEtagForProfiles(teamId string) StoreChannel
|
|
|
|
|
UpdateFailedPasswordAttempts(userId string, attempts int) StoreChannel
|
|
|
|
|
GetTotalUsersCount() StoreChannel
|
|
|
|
|
GetSystemAdminProfiles() StoreChannel
|
|
|
|
|
PermanentDelete(userId string) StoreChannel
|
2016-01-21 12:14:17 -05:00
|
|
|
AnalyticsUniqueUserCount(teamId string) StoreChannel
|
2017-01-20 15:24:53 -05:00
|
|
|
AnalyticsActiveCount(time int64) StoreChannel
|
2016-03-11 00:14:55 -03:00
|
|
|
GetUnreadCount(userId string) StoreChannel
|
2016-08-31 12:52:14 -04:00
|
|
|
GetUnreadCountForChannel(userId string, channelId string) StoreChannel
|
2016-10-19 14:49:25 -04:00
|
|
|
GetRecentlyActiveUsersForTeam(teamId string) StoreChannel
|
2016-11-02 14:38:34 -04:00
|
|
|
Search(teamId string, term string, options map[string]bool) StoreChannel
|
2017-04-03 18:11:12 +01:00
|
|
|
SearchNotInTeam(notInTeamId string, term string, options map[string]bool) StoreChannel
|
2016-11-02 14:38:34 -04:00
|
|
|
SearchInChannel(channelId string, term string, options map[string]bool) StoreChannel
|
|
|
|
|
SearchNotInChannel(teamId string, channelId string, term string, options map[string]bool) StoreChannel
|
2017-03-23 06:34:22 -04:00
|
|
|
SearchWithoutTeam(term string, options map[string]bool) StoreChannel
|
2017-02-24 17:33:59 +00:00
|
|
|
AnalyticsGetInactiveUsersCount() StoreChannel
|
|
|
|
|
AnalyticsGetSystemAdminCount() StoreChannel
|
2017-03-30 02:10:51 +01:00
|
|
|
GetProfilesNotInTeam(teamId string, offset int, limit int) StoreChannel
|
|
|
|
|
GetEtagForProfilesNotInTeam(teamId string) StoreChannel
|
2015-06-14 23:53:32 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SessionStore interface {
|
2016-01-20 13:36:16 -06:00
|
|
|
Save(session *model.Session) StoreChannel
|
|
|
|
|
Get(sessionIdOrToken string) StoreChannel
|
|
|
|
|
GetSessions(userId string) StoreChannel
|
2016-10-24 17:04:11 -07:00
|
|
|
GetSessionsWithActiveDeviceIds(userId string) StoreChannel
|
2016-01-20 13:36:16 -06:00
|
|
|
Remove(sessionIdOrToken string) StoreChannel
|
2016-04-21 22:37:01 -07:00
|
|
|
RemoveAllSessions() StoreChannel
|
2016-01-20 13:36:16 -06:00
|
|
|
PermanentDeleteSessionsByUser(teamId string) StoreChannel
|
|
|
|
|
UpdateLastActivityAt(sessionId string, time int64) StoreChannel
|
|
|
|
|
UpdateRoles(userId string, roles string) StoreChannel
|
2016-07-21 08:36:11 -08:00
|
|
|
UpdateDeviceId(id string, deviceId string, expiresAt int64) StoreChannel
|
2016-04-21 22:37:01 -07:00
|
|
|
AnalyticsSessionCount() StoreChannel
|
2015-06-14 23:53:32 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type AuditStore interface {
|
2016-01-20 13:36:16 -06:00
|
|
|
Save(audit *model.Audit) StoreChannel
|
2017-02-21 21:07:57 +09:00
|
|
|
Get(user_id string, offset int, limit int) StoreChannel
|
2016-01-20 13:36:16 -06:00
|
|
|
PermanentDeleteByUser(userId string) StoreChannel
|
2015-06-14 23:53:32 -08:00
|
|
|
}
|
2015-09-16 15:49:12 -04:00
|
|
|
|
2016-03-14 16:07:58 -07:00
|
|
|
type ComplianceStore interface {
|
|
|
|
|
Save(compliance *model.Compliance) StoreChannel
|
|
|
|
|
Update(compliance *model.Compliance) StoreChannel
|
|
|
|
|
Get(id string) StoreChannel
|
2017-03-13 10:14:16 -04:00
|
|
|
GetAll(offset, limit int) StoreChannel
|
2016-03-14 16:07:58 -07:00
|
|
|
ComplianceExport(compliance *model.Compliance) StoreChannel
|
|
|
|
|
}
|
|
|
|
|
|
2015-09-16 15:49:12 -04:00
|
|
|
type OAuthStore interface {
|
2016-01-20 13:36:16 -06:00
|
|
|
SaveApp(app *model.OAuthApp) StoreChannel
|
|
|
|
|
UpdateApp(app *model.OAuthApp) StoreChannel
|
|
|
|
|
GetApp(id string) StoreChannel
|
|
|
|
|
GetAppByUser(userId string) StoreChannel
|
2016-08-03 12:19:27 -05:00
|
|
|
GetApps() StoreChannel
|
2016-08-23 19:06:17 -03:00
|
|
|
GetAuthorizedApps(userId string) StoreChannel
|
2016-08-03 12:19:27 -05:00
|
|
|
DeleteApp(id string) StoreChannel
|
2016-01-20 13:36:16 -06:00
|
|
|
SaveAuthData(authData *model.AuthData) StoreChannel
|
|
|
|
|
GetAuthData(code string) StoreChannel
|
|
|
|
|
RemoveAuthData(code string) StoreChannel
|
|
|
|
|
PermanentDeleteAuthDataByUser(userId string) StoreChannel
|
|
|
|
|
SaveAccessData(accessData *model.AccessData) StoreChannel
|
2016-08-03 12:19:27 -05:00
|
|
|
UpdateAccessData(accessData *model.AccessData) StoreChannel
|
2016-01-20 13:36:16 -06:00
|
|
|
GetAccessData(token string) StoreChannel
|
2016-08-23 19:06:17 -03:00
|
|
|
GetAccessDataByUserForApp(userId, clientId string) StoreChannel
|
2016-08-03 12:19:27 -05:00
|
|
|
GetAccessDataByRefreshToken(token string) StoreChannel
|
|
|
|
|
GetPreviousAccessData(userId, clientId string) StoreChannel
|
2016-01-20 13:36:16 -06:00
|
|
|
RemoveAccessData(token string) StoreChannel
|
2015-09-16 15:49:12 -04:00
|
|
|
}
|
2015-09-16 19:59:57 -07:00
|
|
|
|
|
|
|
|
type SystemStore interface {
|
2016-01-20 13:36:16 -06:00
|
|
|
Save(system *model.System) StoreChannel
|
2016-02-04 13:00:03 -05:00
|
|
|
SaveOrUpdate(system *model.System) StoreChannel
|
2016-01-20 13:36:16 -06:00
|
|
|
Update(system *model.System) StoreChannel
|
|
|
|
|
Get() StoreChannel
|
2016-04-11 13:45:03 -04:00
|
|
|
GetByName(name string) StoreChannel
|
2015-09-16 19:59:57 -07:00
|
|
|
}
|
2015-09-21 14:22:23 -04:00
|
|
|
|
|
|
|
|
type WebhookStore interface {
|
2016-01-20 13:36:16 -06:00
|
|
|
SaveIncoming(webhook *model.IncomingWebhook) StoreChannel
|
2017-01-27 14:07:34 -05:00
|
|
|
GetIncoming(id string, allowFromCache bool) StoreChannel
|
2017-02-21 19:42:34 -05:00
|
|
|
GetIncomingList(offset, limit int) StoreChannel
|
|
|
|
|
GetIncomingByTeam(teamId string, offset, limit int) StoreChannel
|
2017-02-27 00:18:20 +05:30
|
|
|
UpdateIncoming(webhook *model.IncomingWebhook) StoreChannel
|
2016-01-20 13:36:16 -06:00
|
|
|
GetIncomingByChannel(channelId string) StoreChannel
|
|
|
|
|
DeleteIncoming(webhookId string, time int64) StoreChannel
|
|
|
|
|
PermanentDeleteIncomingByUser(userId string) StoreChannel
|
2017-02-27 00:18:20 +05:30
|
|
|
|
2016-01-20 13:36:16 -06:00
|
|
|
SaveOutgoing(webhook *model.OutgoingWebhook) StoreChannel
|
|
|
|
|
GetOutgoing(id string) StoreChannel
|
2017-03-13 10:40:43 -04:00
|
|
|
GetOutgoingList(offset, limit int) StoreChannel
|
|
|
|
|
GetOutgoingByChannel(channelId string, offset, limit int) StoreChannel
|
|
|
|
|
GetOutgoingByTeam(teamId string, offset, limit int) StoreChannel
|
2016-01-20 13:36:16 -06:00
|
|
|
DeleteOutgoing(webhookId string, time int64) StoreChannel
|
|
|
|
|
PermanentDeleteOutgoingByUser(userId string) StoreChannel
|
|
|
|
|
UpdateOutgoing(hook *model.OutgoingWebhook) StoreChannel
|
2017-02-27 00:18:20 +05:30
|
|
|
|
2016-02-02 08:41:02 -05:00
|
|
|
AnalyticsIncomingCount(teamId string) StoreChannel
|
|
|
|
|
AnalyticsOutgoingCount(teamId string) StoreChannel
|
2017-01-27 14:07:34 -05:00
|
|
|
InvalidateWebhookCache(webhook string)
|
2015-09-21 14:22:23 -04:00
|
|
|
}
|
2015-10-01 10:56:07 -04:00
|
|
|
|
2016-01-06 21:09:05 -06:00
|
|
|
type CommandStore interface {
|
|
|
|
|
Save(webhook *model.Command) StoreChannel
|
|
|
|
|
Get(id string) StoreChannel
|
|
|
|
|
GetByTeam(teamId string) StoreChannel
|
|
|
|
|
Delete(commandId string, time int64) StoreChannel
|
|
|
|
|
PermanentDeleteByUser(userId string) StoreChannel
|
|
|
|
|
Update(hook *model.Command) StoreChannel
|
2016-02-25 12:32:46 -05:00
|
|
|
AnalyticsCommandCount(teamId string) StoreChannel
|
2016-01-06 21:09:05 -06:00
|
|
|
}
|
|
|
|
|
|
2015-10-01 10:56:07 -04:00
|
|
|
type PreferenceStore interface {
|
2016-01-20 13:36:16 -06:00
|
|
|
Save(preferences *model.Preferences) StoreChannel
|
|
|
|
|
Get(userId string, category string, name string) StoreChannel
|
|
|
|
|
GetCategory(userId string, category string) StoreChannel
|
|
|
|
|
GetAll(userId string) StoreChannel
|
2016-07-14 10:08:36 -04:00
|
|
|
Delete(userId, category, name string) StoreChannel
|
2016-12-19 10:05:46 -03:00
|
|
|
DeleteCategory(userId string, category string) StoreChannel
|
2017-01-25 09:32:42 -05:00
|
|
|
DeleteCategoryAndName(category string, name string) StoreChannel
|
2016-01-20 13:36:16 -06:00
|
|
|
PermanentDeleteByUser(userId string) StoreChannel
|
|
|
|
|
IsFeatureEnabled(feature, userId string) StoreChannel
|
2015-11-19 17:54:01 +01:00
|
|
|
}
|
2016-02-04 13:00:03 -05:00
|
|
|
|
|
|
|
|
type LicenseStore interface {
|
|
|
|
|
Save(license *model.LicenseRecord) StoreChannel
|
|
|
|
|
Get(id string) StoreChannel
|
|
|
|
|
}
|
2016-04-21 22:37:01 -07:00
|
|
|
|
|
|
|
|
type PasswordRecoveryStore interface {
|
|
|
|
|
SaveOrUpdate(recovery *model.PasswordRecovery) StoreChannel
|
|
|
|
|
Delete(userId string) StoreChannel
|
|
|
|
|
Get(userId string) StoreChannel
|
|
|
|
|
GetByCode(code string) StoreChannel
|
|
|
|
|
}
|
2016-06-14 09:38:19 -04:00
|
|
|
|
|
|
|
|
type EmojiStore interface {
|
|
|
|
|
Save(emoji *model.Emoji) StoreChannel
|
2017-02-15 19:25:33 -05:00
|
|
|
Get(id string, allowFromCache bool) StoreChannel
|
2016-06-14 09:38:19 -04:00
|
|
|
GetByName(name string) StoreChannel
|
|
|
|
|
GetAll() StoreChannel
|
|
|
|
|
Delete(id string, time int64) StoreChannel
|
|
|
|
|
}
|
2016-07-18 11:10:03 -04:00
|
|
|
|
|
|
|
|
type StatusStore interface {
|
|
|
|
|
SaveOrUpdate(status *model.Status) StoreChannel
|
|
|
|
|
Get(userId string) StoreChannel
|
2016-10-19 14:49:25 -04:00
|
|
|
GetByIds(userIds []string) StoreChannel
|
2016-07-18 11:10:03 -04:00
|
|
|
GetOnlineAway() StoreChannel
|
2016-07-21 10:00:09 -04:00
|
|
|
GetOnline() StoreChannel
|
2016-09-06 15:48:43 -03:00
|
|
|
GetAllFromTeam(teamId string) StoreChannel
|
2016-07-18 11:10:03 -04:00
|
|
|
ResetAll() StoreChannel
|
|
|
|
|
GetTotalActiveUsersCount() StoreChannel
|
|
|
|
|
UpdateLastActivityAt(userId string, lastActivityAt int64) StoreChannel
|
|
|
|
|
}
|
2016-09-30 11:06:30 -04:00
|
|
|
|
|
|
|
|
type FileInfoStore interface {
|
|
|
|
|
Save(info *model.FileInfo) StoreChannel
|
|
|
|
|
Get(id string) StoreChannel
|
|
|
|
|
GetByPath(path string) StoreChannel
|
2017-02-20 13:40:32 -05:00
|
|
|
GetForPost(postId string, readFromMaster bool, allowFromCache bool) StoreChannel
|
2017-02-07 12:36:37 -08:00
|
|
|
InvalidateFileInfosForPostCache(postId string)
|
2016-09-30 11:06:30 -04:00
|
|
|
AttachToPost(fileId string, postId string) StoreChannel
|
|
|
|
|
DeleteForPost(postId string) StoreChannel
|
|
|
|
|
}
|
2016-11-30 13:55:49 -05:00
|
|
|
|
|
|
|
|
type ReactionStore interface {
|
|
|
|
|
Save(reaction *model.Reaction) StoreChannel
|
|
|
|
|
Delete(reaction *model.Reaction) StoreChannel
|
2017-03-07 16:05:01 -05:00
|
|
|
InvalidateCacheForPost(postId string)
|
|
|
|
|
InvalidateCache()
|
|
|
|
|
GetForPost(postId string, allowFromCache bool) StoreChannel
|
2016-11-30 13:55:49 -05:00
|
|
|
DeleteAllWithEmojiName(emojiName string) StoreChannel
|
|
|
|
|
}
|