2017-04-12 08:27:57 -04:00
|
|
|
// Copyright (c) 2016-present 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"
|
|
|
|
|
|
2017-09-06 23:05:10 -07:00
|
|
|
"github.com/mattermost/mattermost-server/model"
|
2015-06-14 23:53:32 -08:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type StoreResult struct {
|
|
|
|
|
Data interface{}
|
|
|
|
|
Err *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type StoreChannel chan StoreResult
|
|
|
|
|
|
2017-10-04 13:09:41 -07:00
|
|
|
func Do(f func(result *StoreResult)) StoreChannel {
|
|
|
|
|
storeChannel := make(StoreChannel, 1)
|
|
|
|
|
go func() {
|
|
|
|
|
result := StoreResult{}
|
|
|
|
|
f(&result)
|
|
|
|
|
storeChannel <- result
|
|
|
|
|
close(storeChannel)
|
|
|
|
|
}()
|
|
|
|
|
return storeChannel
|
|
|
|
|
}
|
|
|
|
|
|
2015-07-06 00:50:42 -08:00
|
|
|
func Must(sc StoreChannel) interface{} {
|
|
|
|
|
r := <-sc
|
|
|
|
|
if r.Err != nil {
|
2018-04-27 12:49:45 -07:00
|
|
|
|
2015-08-20 14:20:39 -07:00
|
|
|
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
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 07:06:45 -08:00
|
|
|
Bot() BotStore
|
2015-06-14 23:53:32 -08:00
|
|
|
Audit() AuditStore
|
2017-06-19 08:44:04 -07:00
|
|
|
ClusterDiscovery() ClusterDiscoveryStore
|
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
|
2017-08-16 07:17:57 -05:00
|
|
|
CommandWebhook() CommandWebhookStore
|
2015-10-01 10:56:07 -04:00
|
|
|
Preference() PreferenceStore
|
2016-02-04 13:00:03 -05:00
|
|
|
License() LicenseStore
|
2017-04-27 10:55:03 -04:00
|
|
|
Token() TokenStore
|
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
|
2018-02-06 15:34:08 +00:00
|
|
|
Role() RoleStore
|
2018-04-20 19:49:13 +01:00
|
|
|
Scheme() SchemeStore
|
2017-07-07 15:21:02 +01:00
|
|
|
Job() JobStore
|
2017-07-31 12:59:32 -04:00
|
|
|
UserAccessToken() UserAccessTokenStore
|
2017-11-30 09:07:04 -05:00
|
|
|
ChannelMemberHistory() ChannelMemberHistoryStore
|
2017-11-27 17:23:35 -05:00
|
|
|
Plugin() PluginStore
|
2018-10-10 00:55:47 +00:00
|
|
|
TermsOfService() TermsOfServiceStore
|
2019-01-10 15:17:31 -05:00
|
|
|
Group() GroupStore
|
2018-11-09 02:18:14 +05:30
|
|
|
UserTermsOfService() UserTermsOfServiceStore
|
2019-01-28 10:25:08 -05:00
|
|
|
LinkMetadata() LinkMetadataStore
|
2015-10-15 11:16:26 -07:00
|
|
|
MarkSystemRanUnitTests()
|
2015-06-14 23:53:32 -08:00
|
|
|
Close()
|
2018-06-27 05:08:40 -04:00
|
|
|
LockToMaster()
|
|
|
|
|
UnlockFromMaster()
|
2016-04-21 22:37:01 -07:00
|
|
|
DropAllTables()
|
2016-10-19 14:49:25 -04:00
|
|
|
TotalMasterDbConnections() int
|
|
|
|
|
TotalReadDbConnections() int
|
2017-05-01 05:19:58 +01:00
|
|
|
TotalSearchDbConnections() int
|
2015-06-14 23:53:32 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type TeamStore interface {
|
2019-04-30 01:19:06 -07:00
|
|
|
Save(team *model.Team) (*model.Team, *model.AppError)
|
2019-04-25 06:29:02 -07:00
|
|
|
Update(team *model.Team) (*model.Team, *model.AppError)
|
2016-01-20 13:36:16 -06:00
|
|
|
UpdateDisplayName(name string, teamId string) StoreChannel
|
2019-04-27 01:18:07 +09:00
|
|
|
Get(id string) (*model.Team, *model.AppError)
|
2016-01-20 13:36:16 -06:00
|
|
|
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
|
2019-03-19 11:36:29 +01:00
|
|
|
SearchPrivate(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
|
2019-03-19 11:36:29 +01:00
|
|
|
GetAllPrivateTeamListing() StoreChannel
|
|
|
|
|
GetAllPrivateTeamPageListing(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
|
2017-10-20 17:34:07 -07:00
|
|
|
SaveMember(member *model.TeamMember, maxUsersPerTeam int) StoreChannel
|
2016-04-21 22:37:01 -07:00
|
|
|
UpdateMember(member *model.TeamMember) StoreChannel
|
2016-05-16 12:55:22 -04:00
|
|
|
GetMember(teamId string, userId string) StoreChannel
|
2019-04-29 16:56:56 +02:00
|
|
|
GetMembers(teamId string, offset int, limit int, restrictions *model.ViewUsersRestrictions) StoreChannel
|
|
|
|
|
GetMembersByIds(teamId string, userIds []string, restrictions *model.ViewUsersRestrictions) 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
|
2019-02-23 11:41:19 -08:00
|
|
|
GetTeamsForUserWithPagination(userId string, page, perPage int) 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
|
2018-03-01 20:11:44 +01:00
|
|
|
UpdateLastTeamIconUpdate(teamId string, curTime int64) StoreChannel
|
2018-04-20 19:49:13 +01:00
|
|
|
GetTeamsByScheme(schemeId string, offset int, limit int) StoreChannel
|
2018-05-14 15:59:04 +01:00
|
|
|
MigrateTeamMembers(fromTeamId string, fromUserId string) StoreChannel
|
2018-05-17 16:28:14 +01:00
|
|
|
ResetAllTeamSchemes() StoreChannel
|
2018-06-25 14:34:59 +01:00
|
|
|
ClearAllCustomRoleAssignments() StoreChannel
|
2018-08-23 11:48:57 +01:00
|
|
|
AnalyticsGetTeamCountForScheme(schemeId string) StoreChannel
|
2018-09-17 15:51:26 +01:00
|
|
|
GetAllForExportAfter(limit int, afterId string) StoreChannel
|
|
|
|
|
GetTeamMembersForExport(userId string) StoreChannel
|
2019-04-29 16:56:56 +02:00
|
|
|
UserBelongsToTeams(userId string, teamIds []string) StoreChannel
|
|
|
|
|
GetUserTeamIds(userId string, allowFromCache bool) StoreChannel
|
|
|
|
|
InvalidateAllTeamIdsForUser(userId string)
|
|
|
|
|
ClearCaches()
|
2015-06-14 23:53:32 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ChannelStore interface {
|
2019-05-27 11:54:04 -04:00
|
|
|
Save(channel *model.Channel, maxChannelsPerTeam int64) (*model.Channel, *model.AppError)
|
2019-05-17 00:04:58 +04:00
|
|
|
CreateDirectChannel(userId string, otherUserId string) (*model.Channel, *model.AppError)
|
|
|
|
|
SaveDirectChannel(channel *model.Channel, member1 *model.ChannelMember, member2 *model.ChannelMember) (*model.Channel, *model.AppError)
|
2019-05-15 01:02:04 +04:00
|
|
|
Update(channel *model.Channel) (*model.Channel, *model.AppError)
|
2019-04-24 15:28:06 -04:00
|
|
|
Get(id string, allowFromCache bool) (*model.Channel, *model.AppError)
|
2017-01-03 09:53:59 -05:00
|
|
|
InvalidateChannel(id string)
|
2017-01-27 14:07:34 -05:00
|
|
|
InvalidateChannelByName(teamId, name string)
|
2019-04-24 15:28:06 -04:00
|
|
|
GetFromMaster(id string) (*model.Channel, *model.AppError)
|
2019-05-16 11:31:50 +01:00
|
|
|
Delete(channelId string, time int64) *model.AppError
|
|
|
|
|
Restore(channelId string, time int64) *model.AppError
|
|
|
|
|
SetDeleteAt(channelId string, deleteAt int64, updateAt int64) *model.AppError
|
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
|
2017-11-28 15:02:56 -06:00
|
|
|
GetByNames(team_id string, names []string, allowFromCache bool) StoreChannel
|
2017-01-27 14:07:34 -05:00
|
|
|
GetByNameIncludeDeleted(team_id string, name string, allowFromCache bool) StoreChannel
|
2017-01-26 02:14:12 +00:00
|
|
|
GetDeletedByName(team_id string, name string) StoreChannel
|
2017-05-09 14:52:46 +02:00
|
|
|
GetDeleted(team_id string, offset int, limit int) StoreChannel
|
2018-07-30 15:06:08 -04:00
|
|
|
GetChannels(teamId string, userId string, includeDeleted bool) StoreChannel
|
2019-05-24 11:28:42 -04:00
|
|
|
GetAllChannels(page, perPage int, opts ChannelSearchOpts) 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
|
2019-03-15 17:53:53 +00:00
|
|
|
GetChannelsByIds(channelIds []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
|
2019-04-15 22:53:52 +02:00
|
|
|
GetMember(channelId string, userId string) (*model.ChannelMember, *model.AppError)
|
2018-10-13 12:35:57 +02:00
|
|
|
GetChannelMembersTimezones(channelId string) StoreChannel
|
2018-07-30 15:06:08 -04:00
|
|
|
GetAllChannelMembersForUser(userId string, allowFromCache bool, includeDeleted bool) StoreChannel
|
2016-10-19 14:49:25 -04:00
|
|
|
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-10-27 12:24:30 -03:00
|
|
|
GetMembersForUser(teamId string, userId string) StoreChannel
|
2019-02-23 11:41:19 -08:00
|
|
|
GetMembersForUserWithPagination(teamId, userId string, page, perPage int) StoreChannel
|
2018-07-30 15:06:08 -04:00
|
|
|
AutocompleteInTeam(teamId string, term string, includeDeleted bool) StoreChannel
|
2018-09-11 22:45:31 +02:00
|
|
|
AutocompleteInTeamForSearch(teamId string, userId string, term string, includeDeleted bool) StoreChannel
|
2019-05-24 11:28:42 -04:00
|
|
|
SearchAllChannels(term string, opts ChannelSearchOpts) StoreChannel
|
2018-07-30 15:06:08 -04:00
|
|
|
SearchInTeam(teamId string, term string, includeDeleted bool) StoreChannel
|
2016-11-24 09:35:09 -05:00
|
|
|
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
|
2019-05-07 09:15:12 -07:00
|
|
|
GetChannelUnread(channelId, userId string) (*model.ChannelUnread, *model.AppError)
|
2018-03-05 10:35:26 -05:00
|
|
|
ClearCaches()
|
2018-04-20 19:49:13 +01:00
|
|
|
GetChannelsByScheme(schemeId string, offset int, limit int) StoreChannel
|
2018-05-14 15:59:04 +01:00
|
|
|
MigrateChannelMembers(fromChannelId string, fromUserId string) StoreChannel
|
2018-05-17 16:28:14 +01:00
|
|
|
ResetAllChannelSchemes() StoreChannel
|
2018-06-25 14:34:59 +01:00
|
|
|
ClearAllCustomRoleAssignments() StoreChannel
|
2018-09-13 13:47:17 -04:00
|
|
|
MigratePublicChannels() error
|
2018-09-17 15:51:26 +01:00
|
|
|
GetAllChannelsForExportAfter(limit int, afterId string) StoreChannel
|
2019-03-15 12:28:43 -03:00
|
|
|
GetAllDirectChannelsForExportAfter(limit int, afterId string) StoreChannel
|
2018-09-17 15:51:26 +01:00
|
|
|
GetChannelMembersForExport(userId string, teamId string) StoreChannel
|
2018-10-08 16:39:03 +01:00
|
|
|
RemoveAllDeactivatedMembers(channelId string) StoreChannel
|
2019-03-19 12:42:08 +00:00
|
|
|
GetChannelsBatchForIndexing(startTime, endTime int64, limit int) StoreChannel
|
2019-04-29 16:56:56 +02:00
|
|
|
UserBelongsToChannels(userId string, channelIds []string) StoreChannel
|
2015-06-14 23:53:32 -08:00
|
|
|
}
|
|
|
|
|
|
2017-11-30 09:07:04 -05:00
|
|
|
type ChannelMemberHistoryStore interface {
|
|
|
|
|
LogJoinEvent(userId string, channelId string, joinTime int64) StoreChannel
|
|
|
|
|
LogLeaveEvent(userId string, channelId string, leaveTime int64) StoreChannel
|
|
|
|
|
GetUsersInChannelDuring(startTime int64, endTime int64, channelId string) StoreChannel
|
2017-12-05 16:32:23 -05:00
|
|
|
PermanentDeleteBatch(endTime int64, limit int64) StoreChannel
|
2017-11-30 09:07:04 -05:00
|
|
|
}
|
|
|
|
|
|
2015-06-14 23:53:32 -08:00
|
|
|
type PostStore interface {
|
2016-01-20 13:36:16 -06:00
|
|
|
Save(post *model.Post) StoreChannel
|
2019-05-30 04:35:46 -04:00
|
|
|
Update(newPost *model.Post, oldPost *model.Post) (*model.Post, *model.AppError)
|
2019-05-21 11:01:30 -07:00
|
|
|
Get(id string) (*model.PostList, *model.AppError)
|
2019-05-30 08:43:45 -04:00
|
|
|
GetSingle(id string) (*model.Post, *model.AppError)
|
2019-05-13 04:07:15 -07:00
|
|
|
Delete(postId string, time int64, deleteByID string) *model.AppError
|
2016-01-20 13:36:16 -06:00
|
|
|
PermanentDeleteByUser(userId string) StoreChannel
|
2019-05-29 08:55:03 -04:00
|
|
|
PermanentDeleteByChannel(channelId string) *model.AppError
|
2019-05-30 10:44:33 -04:00
|
|
|
GetPosts(channelId string, offset int, limit int, allowFromCache bool) (*model.PostList, *model.AppError)
|
2019-05-29 12:05:59 -04:00
|
|
|
GetFlaggedPosts(userId string, offset int, limit int) (*model.PostList, *model.AppError)
|
2019-05-29 10:48:05 -04:00
|
|
|
GetFlaggedPostsForTeam(userId, teamId string, offset int, limit int) (*model.PostList, *model.AppError)
|
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
|
2019-05-31 17:58:24 -04:00
|
|
|
GetEtag(channelId string, allowFromCache bool) string
|
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
|
2018-03-05 10:35:26 -05:00
|
|
|
ClearCaches()
|
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
|
2019-05-17 01:46:18 -07:00
|
|
|
Overwrite(post *model.Post) (*model.Post, *model.AppError)
|
2017-05-18 16:26:52 +01:00
|
|
|
GetPostsByIds(postIds []string) StoreChannel
|
2017-10-25 13:23:01 +01:00
|
|
|
GetPostsBatchForIndexing(startTime int64, endTime int64, limit int) StoreChannel
|
2017-09-15 17:35:55 +01:00
|
|
|
PermanentDeleteBatch(endTime int64, limit int64) StoreChannel
|
2017-10-25 13:23:01 +01:00
|
|
|
GetOldest() StoreChannel
|
2019-05-17 01:46:18 -07:00
|
|
|
GetMaxPostSize() int
|
2018-09-17 15:51:26 +01:00
|
|
|
GetParentsForExportAfter(limit int, afterId string) StoreChannel
|
|
|
|
|
GetRepliesForExport(parentId string) StoreChannel
|
2019-05-30 17:19:14 -04:00
|
|
|
GetDirectPostParentsForExportAfter(limit int, afterId string) ([]*model.DirectPostForExport, *model.AppError)
|
2015-06-14 23:53:32 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type UserStore interface {
|
2016-01-20 13:36:16 -06:00
|
|
|
Save(user *model.User) StoreChannel
|
2019-05-28 09:40:29 +02:00
|
|
|
Update(user *model.User, allowRoleUpdate bool) (*model.UserUpdate, *model.AppError)
|
2016-01-20 13:36:16 -06:00
|
|
|
UpdateLastPictureUpdate(userId string) StoreChannel
|
2018-10-02 08:04:38 +02:00
|
|
|
ResetLastPictureUpdate(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
|
2019-04-15 22:53:52 +02:00
|
|
|
Get(id string) (*model.User, *model.AppError)
|
2016-04-21 22:37:01 -07:00
|
|
|
GetAll() StoreChannel
|
2018-03-05 10:35:26 -05:00
|
|
|
ClearCaches()
|
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
|
2018-03-09 05:48:30 -07:00
|
|
|
GetProfilesInChannelByStatus(channelId string, offset int, limit int) StoreChannel
|
2017-02-03 15:17:34 -05:00
|
|
|
GetAllProfilesInChannel(channelId string, allowFromCache bool) StoreChannel
|
2019-05-16 10:12:06 +01:00
|
|
|
GetProfilesNotInChannel(teamId string, channelId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) StoreChannel
|
2019-04-29 16:56:56 +02:00
|
|
|
GetProfilesWithoutTeam(offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) StoreChannel
|
|
|
|
|
GetProfilesByUsernames(usernames []string, viewRestrictions *model.ViewUsersRestrictions) StoreChannel
|
2019-01-11 14:50:32 +01:00
|
|
|
GetAllProfiles(options *model.UserGetOptions) StoreChannel
|
|
|
|
|
GetProfiles(options *model.UserGetOptions) StoreChannel
|
2019-04-29 16:56:56 +02:00
|
|
|
GetProfileByIds(userId []string, allowFromCache bool, viewRestrictions *model.ViewUsersRestrictions) StoreChannel
|
2016-12-13 19:23:36 -08:00
|
|
|
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
|
2018-05-10 09:46:09 -07:00
|
|
|
GetForLogin(loginId string, allowSignInWithUsername, allowSignInWithEmail bool) StoreChannel
|
2019-02-20 15:50:52 +01:00
|
|
|
VerifyEmail(userId, email 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
|
|
|
|
|
GetSystemAdminProfiles() StoreChannel
|
2019-05-24 15:16:15 +02:00
|
|
|
PermanentDelete(userId string) *model.AppError
|
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
|
2018-09-26 16:34:12 +02:00
|
|
|
GetAnyUnreadPostCountForChannel(userId string, channelId string) StoreChannel
|
2019-04-29 16:56:56 +02:00
|
|
|
GetRecentlyActiveUsersForTeam(teamId string, offset, limit int, viewRestrictions *model.ViewUsersRestrictions) StoreChannel
|
|
|
|
|
GetNewUsersForTeam(teamId string, offset, limit int, viewRestrictions *model.ViewUsersRestrictions) StoreChannel
|
2018-10-17 11:24:12 -04:00
|
|
|
Search(teamId string, term string, options *model.UserSearchOptions) StoreChannel
|
|
|
|
|
SearchNotInTeam(notInTeamId string, term string, options *model.UserSearchOptions) StoreChannel
|
|
|
|
|
SearchInChannel(channelId string, term string, options *model.UserSearchOptions) StoreChannel
|
|
|
|
|
SearchNotInChannel(teamId string, channelId string, term string, options *model.UserSearchOptions) StoreChannel
|
|
|
|
|
SearchWithoutTeam(term string, options *model.UserSearchOptions) StoreChannel
|
2017-02-24 17:33:59 +00:00
|
|
|
AnalyticsGetInactiveUsersCount() StoreChannel
|
|
|
|
|
AnalyticsGetSystemAdminCount() StoreChannel
|
2019-05-16 10:12:06 +01:00
|
|
|
GetProfilesNotInTeam(teamId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) StoreChannel
|
2017-03-30 02:10:51 +01:00
|
|
|
GetEtagForProfilesNotInTeam(teamId string) StoreChannel
|
2018-06-25 14:34:59 +01:00
|
|
|
ClearAllCustomRoleAssignments() StoreChannel
|
2018-08-08 12:04:36 +02:00
|
|
|
InferSystemInstallDate() StoreChannel
|
2018-09-17 15:51:26 +01:00
|
|
|
GetAllAfter(limit int, afterId string) StoreChannel
|
2019-03-19 12:42:08 +00:00
|
|
|
GetUsersBatchForIndexing(startTime, endTime int64, limit int) StoreChannel
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 07:06:45 -08:00
|
|
|
Count(options model.UserCountOptions) StoreChannel
|
2019-04-09 07:09:57 -04:00
|
|
|
GetTeamGroupUsers(teamID string) StoreChannel
|
|
|
|
|
GetChannelGroupUsers(channelID string) StoreChannel
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 07:06:45 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type BotStore interface {
|
|
|
|
|
Get(userId string, includeDeleted bool) StoreChannel
|
|
|
|
|
GetAll(options *model.BotGetOptions) StoreChannel
|
|
|
|
|
Save(bot *model.Bot) StoreChannel
|
|
|
|
|
Update(bot *model.Bot) StoreChannel
|
|
|
|
|
PermanentDelete(userId string) StoreChannel
|
2015-06-14 23:53:32 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SessionStore interface {
|
2019-05-30 18:22:19 -03:00
|
|
|
Get(sessionIdOrToken string) (*model.Session, *model.AppError)
|
2019-05-30 12:10:24 -04:00
|
|
|
Save(session *model.Session) (*model.Session, *model.AppError)
|
2016-01-20 13:36:16 -06:00
|
|
|
GetSessions(userId string) StoreChannel
|
2019-05-28 09:55:04 -04:00
|
|
|
GetSessionsWithActiveDeviceIds(userId string) ([]*model.Session, *model.AppError)
|
2016-01-20 13:36:16 -06:00
|
|
|
Remove(sessionIdOrToken string) StoreChannel
|
2016-04-21 22:37:01 -07:00
|
|
|
RemoveAllSessions() StoreChannel
|
2019-06-03 20:22:02 +09:00
|
|
|
PermanentDeleteSessionsByUser(teamId string) *model.AppError
|
2016-01-20 13:36:16 -06:00
|
|
|
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
|
2019-05-27 12:54:46 -04:00
|
|
|
AnalyticsSessionCount() (int64, *model.AppError)
|
2018-01-17 08:50:49 -05:00
|
|
|
Cleanup(expiryTime int64, batchSize int64)
|
2015-06-14 23:53:32 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type AuditStore interface {
|
2019-04-15 22:53:52 +02:00
|
|
|
Save(audit *model.Audit) *model.AppError
|
|
|
|
|
Get(user_id string, offset int, limit int) (model.Audits, *model.AppError)
|
|
|
|
|
PermanentDeleteByUser(userId string) *model.AppError
|
|
|
|
|
PermanentDeleteBatch(endTime int64, limit int64) (int64, *model.AppError)
|
2015-06-14 23:53:32 -08:00
|
|
|
}
|
2015-09-16 15:49:12 -04:00
|
|
|
|
2017-06-19 08:44:04 -07:00
|
|
|
type ClusterDiscoveryStore interface {
|
2019-04-24 12:36:56 +02:00
|
|
|
Save(discovery *model.ClusterDiscovery) *model.AppError
|
|
|
|
|
Delete(discovery *model.ClusterDiscovery) (bool, *model.AppError)
|
|
|
|
|
Exists(discovery *model.ClusterDiscovery) (bool, *model.AppError)
|
|
|
|
|
GetAll(discoveryType, clusterName string) ([]*model.ClusterDiscovery, *model.AppError)
|
|
|
|
|
SetLastPingAt(discovery *model.ClusterDiscovery) *model.AppError
|
|
|
|
|
Cleanup() *model.AppError
|
2017-06-19 08:44:04 -07:00
|
|
|
}
|
|
|
|
|
|
2016-03-14 16:07:58 -07:00
|
|
|
type ComplianceStore interface {
|
2019-04-24 12:50:25 +02:00
|
|
|
Save(compliance *model.Compliance) (*model.Compliance, *model.AppError)
|
|
|
|
|
Update(compliance *model.Compliance) (*model.Compliance, *model.AppError)
|
|
|
|
|
Get(id string) (*model.Compliance, *model.AppError)
|
|
|
|
|
GetAll(offset, limit int) (model.Compliances, *model.AppError)
|
|
|
|
|
ComplianceExport(compliance *model.Compliance) ([]*model.CompliancePost, *model.AppError)
|
|
|
|
|
MessageExport(after int64, limit int) ([]*model.MessageExport, *model.AppError)
|
2016-03-14 16:07:58 -07:00
|
|
|
}
|
|
|
|
|
|
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
|
2017-04-12 16:29:42 -04:00
|
|
|
GetAppByUser(userId string, offset, limit int) StoreChannel
|
|
|
|
|
GetApps(offset, limit int) StoreChannel
|
|
|
|
|
GetAuthorizedApps(userId string, offset, limit int) 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 {
|
2019-05-21 18:22:27 +02:00
|
|
|
Save(system *model.System) *model.AppError
|
|
|
|
|
SaveOrUpdate(system *model.System) *model.AppError
|
|
|
|
|
Update(system *model.System) *model.AppError
|
|
|
|
|
Get() (model.StringMap, *model.AppError)
|
|
|
|
|
GetByName(name string) (*model.System, *model.AppError)
|
|
|
|
|
PermanentDeleteByName(name string) (*model.System, *model.AppError)
|
2015-09-16 19:59:57 -07:00
|
|
|
}
|
2015-09-21 14:22:23 -04:00
|
|
|
|
|
|
|
|
type WebhookStore interface {
|
2019-04-24 04:30:41 -04:00
|
|
|
SaveIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError)
|
2019-04-16 19:16:30 +02:00
|
|
|
GetIncoming(id string, allowFromCache bool) (*model.IncomingWebhook, *model.AppError)
|
2019-04-24 04:32:30 -04:00
|
|
|
GetIncomingList(offset, limit int) ([]*model.IncomingWebhook, *model.AppError)
|
2019-04-22 08:29:55 -07:00
|
|
|
GetIncomingByTeam(teamId string, offset, limit int) ([]*model.IncomingWebhook, *model.AppError)
|
2019-04-18 14:03:59 +02:00
|
|
|
UpdateIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError)
|
2019-04-22 23:28:08 +08:00
|
|
|
GetIncomingByChannel(channelId string) ([]*model.IncomingWebhook, *model.AppError)
|
2019-04-29 22:34:08 -07:00
|
|
|
DeleteIncoming(webhookId string, time int64) *model.AppError
|
2019-04-25 15:15:32 +09:00
|
|
|
PermanentDeleteIncomingByChannel(channelId string) *model.AppError
|
2019-04-26 08:34:29 -07:00
|
|
|
PermanentDeleteIncomingByUser(userId string) *model.AppError
|
2017-02-27 00:18:20 +05:30
|
|
|
|
2019-04-23 01:39:59 -07:00
|
|
|
SaveOutgoing(webhook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError)
|
2019-04-25 14:19:38 +08:00
|
|
|
GetOutgoing(id string) (*model.OutgoingWebhook, *model.AppError)
|
2019-05-07 04:50:03 -07:00
|
|
|
GetOutgoingByChannel(channelId string, offset, limit int) ([]*model.OutgoingWebhook, *model.AppError)
|
2019-04-25 22:41:45 -07:00
|
|
|
GetOutgoingList(offset, limit int) ([]*model.OutgoingWebhook, *model.AppError)
|
2019-04-26 12:20:36 -07:00
|
|
|
GetOutgoingByTeam(teamId string, offset, limit int) ([]*model.OutgoingWebhook, *model.AppError)
|
2019-04-25 22:44:00 -07:00
|
|
|
DeleteOutgoing(webhookId string, time int64) *model.AppError
|
2019-04-23 21:40:41 +09:00
|
|
|
PermanentDeleteOutgoingByChannel(channelId string) *model.AppError
|
2019-04-26 22:45:02 -07:00
|
|
|
PermanentDeleteOutgoingByUser(userId string) *model.AppError
|
2019-04-26 00:28:04 -07:00
|
|
|
UpdateOutgoing(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError)
|
2017-02-27 00:18:20 +05:30
|
|
|
|
2019-04-25 15:17:43 +09:00
|
|
|
AnalyticsIncomingCount(teamId string) (int64, *model.AppError)
|
2019-05-01 07:37:29 -07:00
|
|
|
AnalyticsOutgoingCount(teamId string) (int64, *model.AppError)
|
2017-01-27 14:07:34 -05:00
|
|
|
InvalidateWebhookCache(webhook string)
|
2018-03-05 10:35:26 -05:00
|
|
|
ClearCaches()
|
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 {
|
2019-04-29 09:07:38 -07:00
|
|
|
Save(webhook *model.Command) (*model.Command, *model.AppError)
|
2019-05-07 11:44:30 -07:00
|
|
|
GetByTrigger(teamId string, trigger string) (*model.Command, *model.AppError)
|
2019-05-06 09:12:41 -07:00
|
|
|
Get(id string) (*model.Command, *model.AppError)
|
2019-04-29 01:20:52 -07:00
|
|
|
GetByTeam(teamId string) ([]*model.Command, *model.AppError)
|
2019-05-01 00:10:27 -07:00
|
|
|
Delete(commandId string, time int64) *model.AppError
|
2019-04-30 02:10:08 -07:00
|
|
|
PermanentDeleteByTeam(teamId string) *model.AppError
|
2019-04-29 01:42:33 -07:00
|
|
|
PermanentDeleteByUser(userId string) *model.AppError
|
2019-04-29 07:22:44 -07:00
|
|
|
Update(hook *model.Command) (*model.Command, *model.AppError)
|
2019-04-30 03:24:05 -07:00
|
|
|
AnalyticsCommandCount(teamId string) (int64, *model.AppError)
|
2016-01-06 21:09:05 -06:00
|
|
|
}
|
|
|
|
|
|
2017-08-16 07:17:57 -05:00
|
|
|
type CommandWebhookStore interface {
|
|
|
|
|
Save(webhook *model.CommandWebhook) StoreChannel
|
|
|
|
|
Get(id string) StoreChannel
|
|
|
|
|
TryUse(id string, limit int) StoreChannel
|
|
|
|
|
Cleanup()
|
|
|
|
|
}
|
|
|
|
|
|
2015-10-01 10:56:07 -04:00
|
|
|
type PreferenceStore interface {
|
2019-05-29 19:24:57 +05:30
|
|
|
Save(preferences *model.Preferences) *model.AppError
|
2019-05-15 15:56:42 +01:00
|
|
|
GetCategory(userId string, category string) (model.Preferences, *model.AppError)
|
2019-05-15 19:20:26 +07:00
|
|
|
Get(userId string, category string, name string) (*model.Preference, *model.AppError)
|
2019-06-03 12:25:04 +01:00
|
|
|
GetAll(userId string) (model.Preferences, *model.AppError)
|
2016-07-14 10:08:36 -04:00
|
|
|
Delete(userId, category, name string) StoreChannel
|
2019-05-28 20:02:39 +09:00
|
|
|
DeleteCategory(userId string, category string) *model.AppError
|
2019-05-28 00:40:50 +09:00
|
|
|
DeleteCategoryAndName(category string, name string) *model.AppError
|
2019-05-20 07:46:41 -04:00
|
|
|
PermanentDeleteByUser(userId string) *model.AppError
|
2019-05-28 10:04:24 -04:00
|
|
|
IsFeatureEnabled(feature, userId string) (bool, *model.AppError)
|
2019-05-24 03:46:07 -04:00
|
|
|
CleanupFlagsBatch(limit int64) (int64, *model.AppError)
|
2015-11-19 17:54:01 +01:00
|
|
|
}
|
2016-02-04 13:00:03 -05:00
|
|
|
|
|
|
|
|
type LicenseStore interface {
|
2019-04-24 20:02:23 +02:00
|
|
|
Save(license *model.LicenseRecord) (*model.LicenseRecord, *model.AppError)
|
|
|
|
|
Get(id string) (*model.LicenseRecord, *model.AppError)
|
2016-02-04 13:00:03 -05:00
|
|
|
}
|
2016-04-21 22:37:01 -07:00
|
|
|
|
2017-04-27 10:55:03 -04:00
|
|
|
type TokenStore interface {
|
|
|
|
|
Save(recovery *model.Token) StoreChannel
|
|
|
|
|
Delete(token string) StoreChannel
|
|
|
|
|
GetByToken(token string) StoreChannel
|
|
|
|
|
Cleanup()
|
2019-03-26 19:30:49 +01:00
|
|
|
RemoveAllTokensByType(tokenType string) StoreChannel
|
2016-04-21 22:37:01 -07:00
|
|
|
}
|
2016-06-14 09:38:19 -04:00
|
|
|
|
|
|
|
|
type EmojiStore interface {
|
2019-05-29 20:32:54 +02:00
|
|
|
Save(emoji *model.Emoji) (*model.Emoji, *model.AppError)
|
2019-05-10 07:57:08 -07:00
|
|
|
Get(id string, allowFromCache bool) (*model.Emoji, *model.AppError)
|
2016-06-14 09:38:19 -04:00
|
|
|
GetByName(name string) StoreChannel
|
2018-08-07 16:24:56 -04:00
|
|
|
GetMultipleByName(names []string) StoreChannel
|
2018-01-19 09:37:59 -05:00
|
|
|
GetList(offset, limit int, sort string) StoreChannel
|
2016-06-14 09:38:19 -04:00
|
|
|
Delete(id string, time int64) StoreChannel
|
2018-01-23 11:04:44 -05:00
|
|
|
Search(name string, prefixOnly bool, limit int) StoreChannel
|
2016-06-14 09:38:19 -04:00
|
|
|
}
|
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 {
|
2019-05-15 22:07:03 +02:00
|
|
|
Save(info *model.FileInfo) (*model.FileInfo, *model.AppError)
|
|
|
|
|
Get(id string) (*model.FileInfo, *model.AppError)
|
|
|
|
|
GetByPath(path string) (*model.FileInfo, *model.AppError)
|
|
|
|
|
GetForPost(postId string, readFromMaster bool, allowFromCache bool) ([]*model.FileInfo, *model.AppError)
|
|
|
|
|
GetForUser(userId string) ([]*model.FileInfo, *model.AppError)
|
2017-02-07 12:36:37 -08:00
|
|
|
InvalidateFileInfosForPostCache(postId string)
|
2019-05-15 22:07:03 +02:00
|
|
|
AttachToPost(fileId string, postId string, creatorId string) *model.AppError
|
|
|
|
|
DeleteForPost(postId string) (string, *model.AppError)
|
|
|
|
|
PermanentDelete(fileId string) *model.AppError
|
|
|
|
|
PermanentDeleteBatch(endTime int64, limit int64) (int64, *model.AppError)
|
|
|
|
|
PermanentDeleteByUser(userId string) (int64, *model.AppError)
|
2018-03-05 10:35:26 -05:00
|
|
|
ClearCaches()
|
2016-09-30 11:06:30 -04:00
|
|
|
}
|
2016-11-30 13:55:49 -05:00
|
|
|
|
|
|
|
|
type ReactionStore interface {
|
2019-04-30 21:34:26 +02:00
|
|
|
Save(reaction *model.Reaction) (*model.Reaction, *model.AppError)
|
|
|
|
|
Delete(reaction *model.Reaction) (*model.Reaction, *model.AppError)
|
|
|
|
|
GetForPost(postId string, allowFromCache bool) ([]*model.Reaction, *model.AppError)
|
|
|
|
|
DeleteAllWithEmojiName(emojiName string) *model.AppError
|
|
|
|
|
PermanentDeleteBatch(endTime int64, limit int64) (int64, *model.AppError)
|
|
|
|
|
BulkGetForPosts(postIds []string) ([]*model.Reaction, *model.AppError)
|
2016-11-30 13:55:49 -05:00
|
|
|
}
|
2017-05-18 15:05:57 -04:00
|
|
|
|
2017-07-07 15:21:02 +01:00
|
|
|
type JobStore interface {
|
|
|
|
|
Save(job *model.Job) StoreChannel
|
|
|
|
|
UpdateOptimistically(job *model.Job, currentStatus string) StoreChannel
|
|
|
|
|
UpdateStatus(id string, status string) StoreChannel
|
|
|
|
|
UpdateStatusOptimistically(id string, currentStatus string, newStatus string) StoreChannel
|
2017-05-18 15:05:57 -04:00
|
|
|
Get(id string) StoreChannel
|
2017-07-20 16:25:35 +01:00
|
|
|
GetAllPage(offset int, limit int) StoreChannel
|
2017-05-18 15:05:57 -04:00
|
|
|
GetAllByType(jobType string) StoreChannel
|
|
|
|
|
GetAllByTypePage(jobType string, offset int, limit int) StoreChannel
|
2017-07-07 15:21:02 +01:00
|
|
|
GetAllByStatus(status string) StoreChannel
|
2017-09-28 17:11:13 +01:00
|
|
|
GetNewestJobByStatusAndType(status string, jobType string) StoreChannel
|
|
|
|
|
GetCountByStatusAndType(status string, jobType string) StoreChannel
|
2017-05-18 15:05:57 -04:00
|
|
|
Delete(id string) StoreChannel
|
|
|
|
|
}
|
2017-07-31 12:59:32 -04:00
|
|
|
|
|
|
|
|
type UserAccessTokenStore interface {
|
|
|
|
|
Save(token *model.UserAccessToken) StoreChannel
|
|
|
|
|
Delete(tokenId string) StoreChannel
|
|
|
|
|
DeleteAllForUser(userId string) StoreChannel
|
|
|
|
|
Get(tokenId string) StoreChannel
|
2018-01-05 14:46:48 -05:00
|
|
|
GetAll(offset int, limit int) StoreChannel
|
2017-07-31 12:59:32 -04:00
|
|
|
GetByToken(tokenString string) StoreChannel
|
|
|
|
|
GetByUser(userId string, page, perPage int) StoreChannel
|
2018-01-11 16:30:55 -05:00
|
|
|
Search(term string) StoreChannel
|
2017-10-19 08:10:29 -04:00
|
|
|
UpdateTokenEnable(tokenId string) StoreChannel
|
|
|
|
|
UpdateTokenDisable(tokenId string) StoreChannel
|
2017-07-31 12:59:32 -04:00
|
|
|
}
|
2017-11-27 17:23:35 -05:00
|
|
|
|
|
|
|
|
type PluginStore interface {
|
|
|
|
|
SaveOrUpdate(keyVal *model.PluginKeyValue) StoreChannel
|
2019-04-23 13:35:17 -04:00
|
|
|
CompareAndSet(keyVal *model.PluginKeyValue, oldValue []byte) (bool, *model.AppError)
|
2017-11-27 17:23:35 -05:00
|
|
|
Get(pluginId, key string) StoreChannel
|
|
|
|
|
Delete(pluginId, key string) StoreChannel
|
2018-10-10 19:55:12 +02:00
|
|
|
DeleteAllForPlugin(PluginId string) StoreChannel
|
|
|
|
|
DeleteAllExpired() StoreChannel
|
2018-10-03 13:04:37 -07:00
|
|
|
List(pluginId string, page, perPage int) StoreChannel
|
2017-11-27 17:23:35 -05:00
|
|
|
}
|
2018-02-06 15:34:08 +00:00
|
|
|
|
|
|
|
|
type RoleStore interface {
|
2019-05-17 17:03:05 +02:00
|
|
|
Save(role *model.Role) (*model.Role, *model.AppError)
|
|
|
|
|
Get(roleId string) (*model.Role, *model.AppError)
|
|
|
|
|
GetAll() ([]*model.Role, *model.AppError)
|
|
|
|
|
GetByName(name string) (*model.Role, *model.AppError)
|
|
|
|
|
GetByNames(names []string) ([]*model.Role, *model.AppError)
|
|
|
|
|
Delete(roldId string) (*model.Role, *model.AppError)
|
|
|
|
|
PermanentDeleteAll() *model.AppError
|
2018-02-06 15:34:08 +00:00
|
|
|
}
|
2018-04-20 19:49:13 +01:00
|
|
|
|
|
|
|
|
type SchemeStore interface {
|
|
|
|
|
Save(scheme *model.Scheme) StoreChannel
|
|
|
|
|
Get(schemeId string) StoreChannel
|
2018-06-21 12:02:35 +01:00
|
|
|
GetByName(schemeName string) StoreChannel
|
2018-05-03 14:00:26 +01:00
|
|
|
GetAllPage(scope string, offset int, limit int) StoreChannel
|
2018-04-20 19:49:13 +01:00
|
|
|
Delete(schemeId string) StoreChannel
|
2018-05-17 16:28:14 +01:00
|
|
|
PermanentDeleteAll() StoreChannel
|
2018-04-20 19:49:13 +01:00
|
|
|
}
|
2018-09-26 20:49:22 +00:00
|
|
|
|
2018-10-10 00:55:47 +00:00
|
|
|
type TermsOfServiceStore interface {
|
|
|
|
|
Save(termsOfService *model.TermsOfService) StoreChannel
|
2018-09-26 20:49:22 +00:00
|
|
|
GetLatest(allowFromCache bool) StoreChannel
|
|
|
|
|
Get(id string, allowFromCache bool) StoreChannel
|
|
|
|
|
}
|
2018-11-09 02:18:14 +05:30
|
|
|
|
|
|
|
|
type UserTermsOfServiceStore interface {
|
|
|
|
|
GetByUser(userId string) StoreChannel
|
|
|
|
|
Save(userTermsOfService *model.UserTermsOfService) StoreChannel
|
|
|
|
|
Delete(userId, termsOfServiceId string) StoreChannel
|
|
|
|
|
}
|
2019-01-10 15:17:31 -05:00
|
|
|
|
|
|
|
|
type GroupStore interface {
|
|
|
|
|
Create(group *model.Group) StoreChannel
|
|
|
|
|
Get(groupID string) StoreChannel
|
|
|
|
|
GetByRemoteID(remoteID string, groupSource model.GroupSource) StoreChannel
|
|
|
|
|
GetAllBySource(groupSource model.GroupSource) StoreChannel
|
|
|
|
|
Update(group *model.Group) StoreChannel
|
|
|
|
|
Delete(groupID string) StoreChannel
|
|
|
|
|
|
|
|
|
|
GetMemberUsers(groupID string) StoreChannel
|
|
|
|
|
GetMemberUsersPage(groupID string, offset int, limit int) StoreChannel
|
|
|
|
|
GetMemberCount(groupID string) StoreChannel
|
|
|
|
|
CreateOrRestoreMember(groupID string, userID string) StoreChannel
|
|
|
|
|
DeleteMember(groupID string, userID string) StoreChannel
|
|
|
|
|
|
2019-05-31 18:27:56 +02:00
|
|
|
CreateGroupSyncable(groupSyncable *model.GroupSyncable) (*model.GroupSyncable, *model.AppError)
|
|
|
|
|
GetGroupSyncable(groupID string, syncableID string, syncableType model.GroupSyncableType) (*model.GroupSyncable, *model.AppError)
|
|
|
|
|
GetAllGroupSyncablesByGroupId(groupID string, syncableType model.GroupSyncableType) ([]*model.GroupSyncable, *model.AppError)
|
|
|
|
|
UpdateGroupSyncable(groupSyncable *model.GroupSyncable) (*model.GroupSyncable, *model.AppError)
|
|
|
|
|
DeleteGroupSyncable(groupID string, syncableID string, syncableType model.GroupSyncableType) (*model.GroupSyncable, *model.AppError)
|
2019-01-10 15:17:31 -05:00
|
|
|
|
2019-05-30 20:38:22 +02:00
|
|
|
TeamMembersToAdd(since int64) ([]*model.UserTeamIDPair, *model.AppError)
|
|
|
|
|
ChannelMembersToAdd(since int64) ([]*model.UserChannelIDPair, *model.AppError)
|
2019-04-02 09:22:50 -04:00
|
|
|
|
2019-05-30 20:38:22 +02:00
|
|
|
TeamMembersToRemove() ([]*model.TeamMember, *model.AppError)
|
|
|
|
|
ChannelMembersToRemove() ([]*model.ChannelMember, *model.AppError)
|
2019-04-02 21:02:51 +01:00
|
|
|
|
2019-05-30 20:39:43 +02:00
|
|
|
GetGroupsByChannel(channelId string, opts model.GroupSearchOpts) ([]*model.Group, *model.AppError)
|
|
|
|
|
CountGroupsByChannel(channelId string, opts model.GroupSearchOpts) (int64, *model.AppError)
|
2019-05-15 12:03:47 -04:00
|
|
|
|
2019-05-30 20:39:43 +02:00
|
|
|
GetGroupsByTeam(teamId string, opts model.GroupSearchOpts) ([]*model.Group, *model.AppError)
|
|
|
|
|
CountGroupsByTeam(teamId string, opts model.GroupSearchOpts) (int64, *model.AppError)
|
2019-05-15 12:03:47 -04:00
|
|
|
|
2019-05-30 20:39:43 +02:00
|
|
|
GetGroups(page, perPage int, opts model.GroupSearchOpts) ([]*model.Group, *model.AppError)
|
2019-01-10 15:17:31 -05:00
|
|
|
}
|
2019-01-28 10:25:08 -05:00
|
|
|
|
|
|
|
|
type LinkMetadataStore interface {
|
|
|
|
|
Save(linkMetadata *model.LinkMetadata) StoreChannel
|
|
|
|
|
Get(url string, timestamp int64) StoreChannel
|
|
|
|
|
}
|
2019-05-24 11:28:42 -04:00
|
|
|
|
|
|
|
|
// ChannelSearchOpts contains options for searching channels.
|
|
|
|
|
//
|
|
|
|
|
// NotAssociatedToGroup will exclude channels that have associated, active GroupChannels records.
|
|
|
|
|
// IncludeDeleted will include channel records where DeleteAt != 0.
|
|
|
|
|
// ExcludeChannelNames will exclude channels from the results by name.
|
|
|
|
|
//
|
|
|
|
|
type ChannelSearchOpts struct {
|
|
|
|
|
NotAssociatedToGroup string
|
|
|
|
|
IncludeDeleted bool
|
|
|
|
|
ExcludeChannelNames []string
|
|
|
|
|
}
|