github.com/vnforks/kid/v5@v5.22.1-0.20200408055009-b89d99c65676/app/app_iface.go (about) 1 // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. 2 // See LICENSE.txt for license information. 3 4 // Code generated by "make app-layers" 5 // DO NOT EDIT 6 7 package app 8 9 import ( 10 "context" 11 "crypto/ecdsa" 12 "html/template" 13 "io" 14 "mime/multipart" 15 "net/http" 16 "net/url" 17 "time" 18 19 "github.com/dyatlov/go-opengraph/opengraph" 20 "github.com/gorilla/websocket" 21 "github.com/mattermost/go-i18n/i18n" 22 goi18n "github.com/mattermost/go-i18n/i18n" 23 "github.com/vnforks/kid/v5/einterfaces" 24 "github.com/vnforks/kid/v5/mlog" 25 "github.com/vnforks/kid/v5/model" 26 "github.com/vnforks/kid/v5/services/filesstore" 27 "github.com/vnforks/kid/v5/services/httpservice" 28 "github.com/vnforks/kid/v5/services/imageproxy" 29 "github.com/vnforks/kid/v5/services/searchengine" 30 "github.com/vnforks/kid/v5/services/timezones" 31 "github.com/vnforks/kid/v5/store" 32 ) 33 34 // AppIface is extracted from App struct and contains all it's exported methods. It's provided to allow partial interface passing and app layers creation. 35 type AppIface interface { 36 AcceptLanguage() string 37 AccountMigration() einterfaces.AccountMigrationInterface 38 ActivateMfa(userId, token string) *model.AppError 39 AddBranchMember(branchId, userId string) (*model.BranchMember, *model.AppError) 40 AddBranchMemberByToken(userId, tokenId string) (*model.BranchMember, *model.AppError) 41 AddBranchMembers(branchId string, userIds []string, userRequestorId string, graceful bool) ([]*model.BranchMemberWithError, *model.AppError) 42 AddClassMember(userId string, class *model.Class, userRequestorId string, postRootId string) (*model.ClassMember, *model.AppError) 43 AddConfigListener(listener func(*model.Config, *model.Config)) string 44 AddCursorIdsForPostList(originalList *model.PostList, afterPost, beforePost string, since int64, page, perPage int) 45 AddDirectClasses(branchId string, user *model.User) *model.AppError 46 AddLicenseListener(listener func(oldLicense, newLicense *model.License)) string 47 AddNotificationEmailToBatch(user *model.User, post *model.Post, branch *model.Branch) *model.AppError 48 AddSamlIdpCertificate(fileData *multipart.FileHeader) *model.AppError 49 AddSamlPrivateCertificate(fileData *multipart.FileHeader) *model.AppError 50 AddSamlPublicCertificate(fileData *multipart.FileHeader) *model.AppError 51 AddSessionToCache(session *model.Session) 52 AddStatusCache(status *model.Status) 53 AddStatusCacheSkipClusterSend(status *model.Status) 54 AddUserToBranch(branchId string, userId string, userRequestorId string) (*model.Branch, *model.AppError) 55 AddUserToBranchByBranchId(branchId string, user *model.User) *model.AppError 56 AddUserToBranchByToken(userId string, tokenId string) (*model.Branch, *model.AppError) 57 AddUserToClass(user *model.User, class *model.Class) (*model.ClassMember, *model.AppError) 58 AllowOAuthAppAccessToUser(userId string, authRequest *model.AuthorizeRequest) (string, *model.AppError) 59 AsymmetricSigningKey() *ecdsa.PrivateKey 60 AttachDeviceId(sessionId string, deviceId string, expiresAt int64) *model.AppError 61 AttachSessionCookies(w http.ResponseWriter, r *http.Request) 62 AuthenticateUserForLogin(id, loginId, password, mfaToken string, ldapOnly bool) (*model.User, *model.AppError) 63 AuthorizeOAuthUser(w http.ResponseWriter, r *http.Request, service, code, state, redirectUri string) (io.ReadCloser, string, map[string]string, *model.AppError) 64 BroadcastStatus(status *model.Status) 65 BuildPushNotificationMessage(contentsConfig string, post *model.Post, user *model.User, class *model.Class, className string, senderName string, explicitMention bool, classWideMention bool, replyToThreadType string) (*model.PushNotification, *model.AppError) 66 BuildSamlMetadataObject(idpMetadata []byte) (*model.SamlMetadataResponse, *model.AppError) 67 BulkExport(writer io.Writer, file string, pathToEmojiDir string, dirNameToExportEmoji string) *model.AppError 68 CancelJob(jobId string) *model.AppError 69 CheckForClientSideCert(r *http.Request) (string, string, string) 70 CheckPasswordAndAllCriteria(user *model.User, password string, mfaToken string) *model.AppError 71 CheckRolesExist(roleNames []string) *model.AppError 72 CheckUserAllAuthenticationCriteria(user *model.User, mfaToken string) *model.AppError 73 CheckUserMfa(user *model.User, token string) *model.AppError 74 CheckUserNotificationMessageflightAuthenticationCriteria(user *model.User) *model.AppError 75 CheckUserPostflightAuthenticationCriteria(user *model.User) *model.AppError 76 CheckUserPreflightAuthenticationCriteria(user *model.User, mfaToken string) *model.AppError 77 ClearBranchMembersCache(branchID string) 78 ClearClassMembersCache(classID string) 79 ClearSessionCacheForAllUsers() 80 ClearSessionCacheForAllUsersSkipClusterSend() 81 ClearSessionCacheForUser(userId string) 82 ClearSessionCacheForUserSkipClusterSend(userId string) 83 ClientConfig() map[string]string 84 ClientConfigHash() string 85 ClientConfigWithComputed() map[string]string 86 ClientLicense() map[string]string 87 Cluster() einterfaces.ClusterInterface 88 CompleteOAuth(service string, body io.ReadCloser, branchId string, props map[string]string) (*model.User, *model.AppError) 89 CompleteSwitchWithOAuth(service string, userData io.Reader, email string) (*model.User, *model.AppError) 90 Compliance() einterfaces.ComplianceInterface 91 Config() *model.Config 92 Context() context.Context 93 CopyFileInfos(userId string, fileIds []string) ([]string, *model.AppError) 94 CreateBranch(branch *model.Branch) (*model.Branch, *model.AppError) 95 CreateBranchWithUser(branch *model.Branch, userId string) (*model.Branch, *model.AppError) 96 CreateClass(class *model.Class, addMember bool) (*model.Class, *model.AppError) 97 CreateClassScheme(class *model.Class) (*model.Scheme, *model.AppError) 98 CreateClassWithUser(class *model.Class, userId string) (*model.Class, *model.AppError) 99 CreateCommand(cmd *model.Command) (*model.Command, *model.AppError) 100 CreateDefaultClasses(branchID string) ([]*model.Class, *model.AppError) 101 CreateEmoji(sessionUserId string, emoji *model.Emoji, multiPartImageData *multipart.Form) (*model.Emoji, *model.AppError) 102 CreateGuest(user *model.User) (*model.User, *model.AppError) 103 CreateJob(job *model.Job) (*model.Job, *model.AppError) 104 CreateOAuthApp(app *model.OAuthApp) (*model.OAuthApp, *model.AppError) 105 CreateOAuthStateToken(extra string) (*model.Token, *model.AppError) 106 CreateOAuthUser(service string, userData io.Reader, branchId string) (*model.User, *model.AppError) 107 CreatePasswordRecoveryToken(userId, email string) (*model.Token, *model.AppError) 108 CreatePost(post *model.Post, class *model.Class, triggerWebhooks bool) (*model.Post, *model.AppError) 109 CreatePostAsUser(post *model.Post, currentSessionId string) (*model.Post, *model.AppError) 110 CreatePostMissingClass(post *model.Post, triggerWebhooks bool) (*model.Post, *model.AppError) 111 CreateRole(role *model.Role) (*model.Role, *model.AppError) 112 CreateScheme(scheme *model.Scheme) (*model.Scheme, *model.AppError) 113 CreateSession(session *model.Session) (*model.Session, *model.AppError) 114 CreateTermsOfService(text, userId string) (*model.TermsOfService, *model.AppError) 115 CreateUser(user *model.User) (*model.User, *model.AppError) 116 CreateUserAccessToken(token *model.UserAccessToken) (*model.UserAccessToken, *model.AppError) 117 CreateUserAsAdmin(user *model.User) (*model.User, *model.AppError) 118 CreateUserFromSignup(user *model.User) (*model.User, *model.AppError) 119 CreateUserWithToken(user *model.User, token *model.Token) (*model.User, *model.AppError) 120 CreateVerifyEmailToken(userId string, newEmail string) (*model.Token, *model.AppError) 121 DataRetention() einterfaces.DataRetentionInterface 122 DeactivateMfa(userId string) *model.AppError 123 DeauthorizeOAuthAppForUser(userId, appId string) *model.AppError 124 DefaultClassNames() []string 125 DeleteBrandImage() *model.AppError 126 DeleteClass(class *model.Class, userId string) *model.AppError 127 DeleteClassScheme(class *model.Class) (*model.Class, *model.AppError) 128 DeleteCommand(commandId string) *model.AppError 129 DeleteEmoji(emoji *model.Emoji) *model.AppError 130 DeleteEphemeralPost(userId, postId string) 131 DeleteFlaggedPosts(postId string) 132 DeleteOAuthApp(appId string) *model.AppError 133 DeletePost(postId, deleteByID string) (*model.Post, *model.AppError) 134 DeletePostFiles(post *model.Post) 135 DeletePreferences(userId string, preferences model.Preferences) *model.AppError 136 DeleteReactionForPost(reaction *model.Reaction) *model.AppError 137 DeleteScheme(schemeId string) (*model.Scheme, *model.AppError) 138 DeleteToken(token *model.Token) *model.AppError 139 DiagnosticId() string 140 DisableUserAccessToken(token *model.UserAccessToken) *model.AppError 141 DoAdvancedPermissionsMigration() 142 DoAppMigrations() 143 DoEmojisPermissionsMigration() 144 DoLogin(w http.ResponseWriter, r *http.Request, user *model.User, deviceId string) *model.AppError 145 DoPermissionsMigrations() error 146 DoUploadFile(now time.Time, rawBranchId string, rawClassId string, rawUserId string, rawFilename string, data []byte) (*model.FileInfo, *model.AppError) 147 DoUploadFileExpectModification(now time.Time, rawBranchId string, rawClassId string, rawUserId string, rawFilename string, data []byte) (*model.FileInfo, []byte, *model.AppError) 148 DoubleCheckPassword(user *model.User, password string) *model.AppError 149 DownloadFromURL(downloadURL string) ([]byte, error) 150 EnableUserAccessToken(token *model.UserAccessToken) *model.AppError 151 EnvironmentConfig() map[string]interface{} 152 ExecuteCommand(args *model.CommandArgs) (*model.CommandResponse, *model.AppError) 153 ExportPermissions(w io.Writer) error 154 FetchSamlMetadataFromIdp(url string) ([]byte, *model.AppError) 155 FileBackend() (filesstore.FileBackend, *model.AppError) 156 FileExists(path string) (bool, *model.AppError) 157 FileReader(path string) (filesstore.ReadCloseSeeker, *model.AppError) 158 FindBranchByName(name string) bool 159 GenerateMfaSecret(userId string) (*model.MfaSecret, *model.AppError) 160 GeneratePublicLink(siteURL string, info *model.FileInfo) string 161 GetAllBranches() ([]*model.Branch, *model.AppError) 162 GetAllBranchesPage(offset int, limit int) ([]*model.Branch, *model.AppError) 163 GetAllBranchesPageWithCount(offset int, limit int) (*model.BranchesWithCount, *model.AppError) 164 GetAllClasses(page, perPage int, opts model.ClassSearchOpts) (*model.ClassListWithBranchData, *model.AppError) 165 GetAllClassesCount(opts model.ClassSearchOpts) (int64, *model.AppError) 166 GetAllRoles() ([]*model.Role, *model.AppError) 167 GetAllStatuses() map[string]*model.Status 168 GetAnalytics(name string, branchId string) (model.AnalyticsRows, *model.AppError) 169 GetAudits(userId string, limit int) (model.Audits, *model.AppError) 170 GetAuditsPage(userId string, page int, perPage int) (model.Audits, *model.AppError) 171 GetAuthorizationCode(w http.ResponseWriter, r *http.Request, service string, props map[string]string, loginHint string) (string, *model.AppError) 172 GetAuthorizedAppsForUser(userId string, page, perPage int) ([]*model.OAuthApp, *model.AppError) 173 GetBranch(branchId string) (*model.Branch, *model.AppError) 174 GetBranchByName(name string) (*model.Branch, *model.AppError) 175 GetBranchIcon(branch *model.Branch) ([]byte, *model.AppError) 176 GetBranchIdFromQuery(query url.Values) (string, *model.AppError) 177 GetBranchMember(branchId, userId string) (*model.BranchMember, *model.AppError) 178 GetBranchMembers(branchId string, offset int, limit int, branchMembersGetOptions *model.BranchMembersGetOptions) ([]*model.BranchMember, *model.AppError) 179 GetBranchMembersByIds(branchId string, userIds []string, restrictions *model.ViewUsersRestrictions) ([]*model.BranchMember, *model.AppError) 180 GetBranchMembersForUser(userId string) ([]*model.BranchMember, *model.AppError) 181 GetBranchMembersForUserWithPagination(userId string, page, perPage int) ([]*model.BranchMember, *model.AppError) 182 GetBranchSchemeClassRoles(branchId string) (string, string, *model.AppError) 183 GetBranchStats(branchId string, restrictions *model.ViewUsersRestrictions) (*model.BranchStats, *model.AppError) 184 GetBranchesForScheme(scheme *model.Scheme, offset int, limit int) ([]*model.Branch, *model.AppError) 185 GetBranchesForSchemePage(scheme *model.Scheme, page int, perPage int) ([]*model.Branch, *model.AppError) 186 GetBranchesForUser(userId string) ([]*model.Branch, *model.AppError) 187 GetBrandImage() ([]byte, *model.AppError) 188 GetBulkReactionsForPosts(postIds []string) (map[string][]*model.Reaction, *model.AppError) 189 GetClass(classId string) (*model.Class, *model.AppError) 190 GetClassByName(className, branchId string, includeDeleted bool) (*model.Class, *model.AppError) 191 GetClassByNameForBranchName(className, branchName string, includeDeleted bool) (*model.Class, *model.AppError) 192 GetClassMember(classId string, userId string) (*model.ClassMember, *model.AppError) 193 GetClassMemberCount(classId string) (int64, *model.AppError) 194 GetClassMembersByIds(classId string, userIds []string) (*model.ClassMembers, *model.AppError) 195 GetClassMembersForUser(branchId string, userId string) (*model.ClassMembers, *model.AppError) 196 GetClassMembersForUserWithPagination(branchId, userId string, page, perPage int) ([]*model.ClassMember, *model.AppError) 197 GetClassMembersPage(classId string, page, perPage int) (*model.ClassMembers, *model.AppError) 198 GetClassMembersTimezones(classId string) ([]string, *model.AppError) 199 GetClassModerationsForClass(class *model.Class) ([]*model.ClassModeration, *model.AppError) 200 GetClassesByNames(classNames []string, branchId string) ([]*model.Class, *model.AppError) 201 GetClassesForScheme(scheme *model.Scheme, offset int, limit int) (model.ClassList, *model.AppError) 202 GetClassesForSchemePage(scheme *model.Scheme, page int, perPage int) (model.ClassList, *model.AppError) 203 GetClassesForUser(branchId string, userId string, includeDeleted bool) (*model.ClassList, *model.AppError) 204 GetClassesUserNotIn(branchId string, userId string, offset int, limit int) (*model.ClassList, *model.AppError) 205 GetClusterId() string 206 GetClusterStatus() []*model.ClusterInfo 207 GetCommand(commandId string) (*model.Command, *model.AppError) 208 GetComplianceFile(job *model.Compliance) ([]byte, *model.AppError) 209 GetComplianceReport(reportId string) (*model.Compliance, *model.AppError) 210 GetComplianceReports(page, perPage int) (model.Compliances, *model.AppError) 211 GetConfigFile(name string) ([]byte, error) 212 GetCookieDomain() string 213 GetDataRetentionPolicy() (*model.DataRetentionPolicy, *model.AppError) 214 GetDefaultProfileImage(user *model.User) ([]byte, *model.AppError) 215 GetDeletedClasses(branchId string, offset int, limit int, userId string) (*model.ClassList, *model.AppError) 216 GetEmoji(emojiId string) (*model.Emoji, *model.AppError) 217 GetEmojiByName(emojiName string) (*model.Emoji, *model.AppError) 218 GetEmojiImage(emojiId string) ([]byte, string, *model.AppError) 219 GetEmojiList(page, perPage int, sort string) ([]*model.Emoji, *model.AppError) 220 GetEmojiStaticUrl(emojiName string) (string, *model.AppError) 221 GetEnvironmentConfig() map[string]interface{} 222 GetFile(fileId string) ([]byte, *model.AppError) 223 GetFileInfo(fileId string) (*model.FileInfo, *model.AppError) 224 GetFileInfos(page, perPage int, opt *model.GetFileInfosOptions) ([]*model.FileInfo, *model.AppError) 225 GetFileInfosForPost(postId string, fromMaster bool) ([]*model.FileInfo, *model.AppError) 226 GetFileInfosForPostWithMigration(postId string) ([]*model.FileInfo, *model.AppError) 227 GetFlaggedPosts(userId string, offset int, limit int) (*model.PostList, *model.AppError) 228 GetFlaggedPostsForBranch(userId, branchId string, offset int, limit int) (*model.PostList, *model.AppError) 229 GetFlaggedPostsForClass(userId, classId string, offset int, limit int) (*model.PostList, *model.AppError) 230 GetHubForUserId(userId string) *Hub 231 GetJob(id string) (*model.Job, *model.AppError) 232 GetJobs(offset int, limit int) ([]*model.Job, *model.AppError) 233 GetJobsByType(jobType string, offset int, limit int) ([]*model.Job, *model.AppError) 234 GetJobsByTypePage(jobType string, page int, perPage int) ([]*model.Job, *model.AppError) 235 GetJobsPage(page int, perPage int) ([]*model.Job, *model.AppError) 236 GetLatestTermsOfService() (*model.TermsOfService, *model.AppError) 237 GetLogs(page, perPage int) ([]string, *model.AppError) 238 GetLogsSkipSend(page, perPage int) ([]string, *model.AppError) 239 GetMessageForNotification(post *model.Post, translateFunc i18n.TranslateFunc) string 240 GetMultipleEmojiByName(names []string) ([]*model.Emoji, *model.AppError) 241 GetNewUsersForBranchPage(branchId string, page, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) 242 GetNextPostIdFromPostList(postList *model.PostList) string 243 GetNotificationNameFormat(user *model.User) string 244 GetNumberOfClassesOnBranch(branchId string) (int, *model.AppError) 245 GetOAuthAccessTokenForCodeFlow(clientId, grantType, redirectUri, code, secret, refreshToken string) (*model.AccessResponse, *model.AppError) 246 GetOAuthAccessTokenForImplicitFlow(userId string, authRequest *model.AuthorizeRequest) (*model.Session, *model.AppError) 247 GetOAuthApp(appId string) (*model.OAuthApp, *model.AppError) 248 GetOAuthApps(page, perPage int) ([]*model.OAuthApp, *model.AppError) 249 GetOAuthAppsByCreator(userId string, page, perPage int) ([]*model.OAuthApp, *model.AppError) 250 GetOAuthCodeRedirect(userId string, authRequest *model.AuthorizeRequest) (string, *model.AppError) 251 GetOAuthImplicitRedirect(userId string, authRequest *model.AuthorizeRequest) (string, *model.AppError) 252 GetOAuthLoginEndpoint(w http.ResponseWriter, r *http.Request, service, branchId, action, redirectTo, loginHint string) (string, *model.AppError) 253 GetOAuthSignupEndpoint(w http.ResponseWriter, r *http.Request, service, branchId string) (string, *model.AppError) 254 GetOAuthStateToken(token string) (*model.Token, *model.AppError) 255 GetOpenGraphMetadata(requestURL string) *opengraph.OpenGraph 256 GetPasswordRecoveryToken(token string) (*model.Token, *model.AppError) 257 GetPermalinkPost(postId string, userId string) (*model.PostList, *model.AppError) 258 GetPostAfterTime(classId string, time int64) (*model.Post, *model.AppError) 259 GetPostIdAfterTime(classId string, time int64) (string, *model.AppError) 260 GetPostIdBeforeTime(classId string, time int64) (string, *model.AppError) 261 GetPosts(classId string, offset int, limit int) (*model.PostList, *model.AppError) 262 GetPostsAfterPost(options model.GetPostsOptions) (*model.PostList, *model.AppError) 263 GetPostsAroundPost(before bool, options model.GetPostsOptions) (*model.PostList, *model.AppError) 264 GetPostsBeforePost(options model.GetPostsOptions) (*model.PostList, *model.AppError) 265 GetPostsEtag(classId string) string 266 GetPostsPage(options model.GetPostsOptions) (*model.PostList, *model.AppError) 267 GetPostsSince(options model.GetPostsSinceOptions) (*model.PostList, *model.AppError) 268 GetPreferenceByCategoryAndNameForUser(userId string, category string, preferenceName string) (*model.Preference, *model.AppError) 269 GetPreferenceByCategoryForUser(userId string, category string) (model.Preferences, *model.AppError) 270 GetPreferencesForUser(userId string) (model.Preferences, *model.AppError) 271 GetPrevPostIdFromPostList(postList *model.PostList) string 272 GetProfileImage(user *model.User) ([]byte, bool, *model.AppError) 273 GetReactionsForPost(postId string) ([]*model.Reaction, *model.AppError) 274 GetRecentlyActiveUsersForBranch(branchId string) (map[string]*model.User, *model.AppError) 275 GetRecentlyActiveUsersForBranchPage(branchId string, page, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) 276 GetRole(id string) (*model.Role, *model.AppError) 277 GetRoleByName(name string) (*model.Role, *model.AppError) 278 GetRolesByNames(names []string) ([]*model.Role, *model.AppError) 279 GetSamlCertificateStatus() *model.SamlCertificateStatus 280 GetSamlMetadata() (string, *model.AppError) 281 GetSamlMetadataFromIdp(idpMetadataUrl string) (*model.SamlMetadataResponse, *model.AppError) 282 GetSanitizeOptions(asAdmin bool) map[string]bool 283 GetSanitizedClientLicense() map[string]string 284 GetSanitizedConfig() *model.Config 285 GetScheme(id string) (*model.Scheme, *model.AppError) 286 GetSchemeByName(name string) (*model.Scheme, *model.AppError) 287 GetSchemeRolesForBranch(branchId string) (string, string, *model.AppError) 288 GetSchemeRolesForClass(classId string) (string, string, *model.AppError) 289 GetSchemes(scope string, offset int, limit int) ([]*model.Scheme, *model.AppError) 290 GetSchemesPage(scope string, page int, perPage int) ([]*model.Scheme, *model.AppError) 291 GetSession(token string) (*model.Session, *model.AppError) 292 GetSessionById(sessionId string) (*model.Session, *model.AppError) 293 GetSessions(userId string) ([]*model.Session, *model.AppError) 294 GetSinglePost(postId string) (*model.Post, *model.AppError) 295 GetSiteURL() string 296 GetStatus(userId string) (*model.Status, *model.AppError) 297 GetStatusFromCache(userId string) *model.Status 298 GetStatusesByIds(userIds []string) (map[string]interface{}, *model.AppError) 299 GetT() goi18n.TranslateFunc 300 GetTermsOfService(id string) (*model.TermsOfService, *model.AppError) 301 GetTotalUsersStats(viewRestrictions *model.ViewUsersRestrictions) (*model.UsersStats, *model.AppError) 302 GetUser(userId string) (*model.User, *model.AppError) 303 GetUserAccessToken(tokenId string, sanitize bool) (*model.UserAccessToken, *model.AppError) 304 GetUserAccessTokens(page, perPage int) ([]*model.UserAccessToken, *model.AppError) 305 GetUserAccessTokensForUser(userId string, page, perPage int) ([]*model.UserAccessToken, *model.AppError) 306 GetUserByAuth(authData *string, authService string) (*model.User, *model.AppError) 307 GetUserByEmail(email string) (*model.User, *model.AppError) 308 GetUserByUsername(username string) (*model.User, *model.AppError) 309 GetUserForLogin(id, loginId string) (*model.User, *model.AppError) 310 GetUserStatusesByIds(userIds []string) ([]*model.Status, *model.AppError) 311 GetUserTermsOfService(userId string) (*model.UserTermsOfService, *model.AppError) 312 GetUsers(options *model.UserGetOptions) ([]*model.User, *model.AppError) 313 GetUsersByIds(userIds []string, options *store.UserGetByIdsOpts) ([]*model.User, *model.AppError) 314 GetUsersByUsernames(usernames []string, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) 315 GetUsersEtag(restrictionsHash string) string 316 GetUsersInBranch(options *model.UserGetOptions) ([]*model.User, *model.AppError) 317 GetUsersInBranchEtag(branchId string, restrictionsHash string) string 318 GetUsersInBranchPage(options *model.UserGetOptions, asAdmin bool) ([]*model.User, *model.AppError) 319 GetUsersInClass(classId string, offset int, limit int) ([]*model.User, *model.AppError) 320 GetUsersInClassByStatus(classId string, offset int, limit int) ([]*model.User, *model.AppError) 321 GetUsersInClassMap(classId string, offset int, limit int, asAdmin bool) (map[string]*model.User, *model.AppError) 322 GetUsersInClassPage(classId string, page int, perPage int, asAdmin bool) ([]*model.User, *model.AppError) 323 GetUsersInClassPageByStatus(classId string, page int, perPage int, asAdmin bool) ([]*model.User, *model.AppError) 324 GetUsersNotInClass(branchId string, classId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) 325 GetUsersNotInClassMap(branchId string, classId string, groupConstrained bool, offset int, limit int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) (map[string]*model.User, *model.AppError) 326 GetUsersNotInClassPage(branchId string, classId string, groupConstrained bool, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) 327 GetUsersPage(options *model.UserGetOptions, asAdmin bool) ([]*model.User, *model.AppError) 328 GetUsersWithoutBranch(options *model.UserGetOptions) ([]*model.User, *model.AppError) 329 GetUsersWithoutBranchPage(options *model.UserGetOptions, asAdmin bool) ([]*model.User, *model.AppError) 330 GetVerifyEmailToken(token string) (*model.Token, *model.AppError) 331 GetViewUsersRestrictions(userId string) (*model.ViewUsersRestrictions, *model.AppError) 332 HTMLTemplates() *template.Template 333 HTTPService() httpservice.HTTPService 334 Handle404(w http.ResponseWriter, r *http.Request) 335 HandleCommandResponse(command *model.Command, args *model.CommandArgs, response *model.CommandResponse, builtIn bool) (*model.CommandResponse, *model.AppError) 336 HandleImages(previewPathList []string, thumbnailPathList []string, fileData [][]byte) 337 HandleMessageExportConfig(cfg *model.Config, appCfg *model.Config) 338 HasPermissionTo(askingUserId string, permission *model.Permission) bool 339 HasPermissionToBranch(askingUserId string, branchId string, permission *model.Permission) bool 340 HasPermissionToClass(askingUserId string, classId string, permission *model.Permission) bool 341 HasPermissionToUser(askingUserId string, userId string) bool 342 HubRegister(webConn *WebConn) 343 HubStart() 344 HubStop() 345 HubUnregister(webConn *WebConn) 346 ImageProxy() *imageproxy.ImageProxy 347 ImageProxyAdder() func(string) string 348 ImageProxyRemover() func(string) string 349 ImportPermissions(jsonl io.Reader) error 350 InitPostMetadata() 351 InvalidateAllCaches() *model.AppError 352 InvalidateAllCachesSkipSend() 353 InvalidateCacheForUser(userId string) 354 InvalidateWebConnSessionCacheForUser(userId string) 355 IpAddress() string 356 IsFirstUserAccount() bool 357 IsLeader() bool 358 IsPasswordValid(password string) *model.AppError 359 IsPhase2MigrationCompleted() *model.AppError 360 IsUserAway(lastActivityAt int64) bool 361 IsUserSignUpAllowed() *model.AppError 362 IsUsernameTaken(name string) bool 363 JoinClass(class *model.Class, userId string) *model.AppError 364 JoinDefaultClasses(branchId string, user *model.User, shouldBeAdmin bool, userRequestorId string) *model.AppError 365 JoinUserToBranch(branch *model.Branch, user *model.User, userRequestorId string) *model.AppError 366 Ldap() einterfaces.LdapInterface 367 LeaveBranch(branch *model.Branch, user *model.User, requestorId string) *model.AppError 368 LeaveClass(classId string, userId string) *model.AppError 369 License() *model.License 370 LimitedClientConfig() map[string]string 371 LimitedClientConfigWithComputed() map[string]string 372 ListAllCommands(branchId string, T goi18n.TranslateFunc) ([]*model.Command, *model.AppError) 373 ListAutocompleteCommands(branchId string, T goi18n.TranslateFunc) ([]*model.Command, *model.AppError) 374 ListBranchCommands(branchId string) ([]*model.Command, *model.AppError) 375 ListDirectory(path string) ([]string, *model.AppError) 376 LoadLicense() 377 Log() *mlog.Logger 378 LoginByOAuth(service string, userData io.Reader, branchId string) (*model.User, *model.AppError) 379 MakePermissionError(permission *model.Permission) *model.AppError 380 MaxPostSize() int 381 MessageExport() einterfaces.MessageExportInterface 382 Metrics() einterfaces.MetricsInterface 383 MigrateFilenamesToFileInfos(post *model.Post) []*model.FileInfo 384 MoveClass(branch *model.Branch, class *model.Class, user *model.User, removeDeactivatedMembers bool) *model.AppError 385 MoveCommand(branch *model.Branch, command *model.Command) *model.AppError 386 MoveFile(oldPath, newPath string) *model.AppError 387 NewClusterDiscoveryService() *ClusterDiscoveryService 388 NewWebConn(ws *websocket.Conn, session model.Session, t goi18n.TranslateFunc, locale string) *WebConn 389 NewWebHub() *Hub 390 Notification() einterfaces.NotificationInterface 391 NotificationsLog() *mlog.Logger 392 OriginChecker() func(*http.Request) bool 393 OverrideIconURLIfEmoji(post *model.Post) 394 PatchBranch(branchId string, patch *model.BranchPatch) (*model.Branch, *model.AppError) 395 PatchClass(class *model.Class, patch *model.ClassPatch, userId string) (*model.Class, *model.AppError) 396 PatchClassModerationsForClass(class *model.Class, classModerationsPatch []*model.ClassModerationPatch) ([]*model.ClassModeration, *model.AppError) 397 PatchPost(postId string, patch *model.PostPatch) (*model.Post, *model.AppError) 398 PatchRole(role *model.Role, patch *model.RolePatch) (*model.Role, *model.AppError) 399 PatchScheme(scheme *model.Scheme, patch *model.SchemePatch) (*model.Scheme, *model.AppError) 400 PatchUser(userId string, patch *model.UserPatch, asAdmin bool) (*model.User, *model.AppError) 401 Path() string 402 PermanentDeleteAllUsers() *model.AppError 403 PermanentDeleteBranch(branch *model.Branch) *model.AppError 404 PermanentDeleteBranchId(branchId string) *model.AppError 405 PermanentDeleteClass(class *model.Class) *model.AppError 406 PermanentDeleteUser(user *model.User) *model.AppError 407 PostActionCookieSecret() []byte 408 PostPatchWithProxyRemovedFromImageURLs(patch *model.PostPatch) *model.PostPatch 409 PostWithProxyAddedToImageURLs(post *model.Post) *model.Post 410 PostWithProxyRemovedFromImageURLs(post *model.Post) *model.Post 411 PreparePostForClient(originalPost *model.Post, isNewPost bool, isEditPost bool) *model.Post 412 PreparePostListForClient(originalList *model.PostList) *model.PostList 413 Publish(message *model.WebSocketEvent) 414 PublishSkipClusterSend(message *model.WebSocketEvent) 415 PurgeElasticsearchIndexes() *model.AppError 416 ReadFile(path string) ([]byte, *model.AppError) 417 RecycleDatabaseConnection() 418 RegenCommandToken(cmd *model.Command) (*model.Command, *model.AppError) 419 RegenerateOAuthAppSecret(app *model.OAuthApp) (*model.OAuthApp, *model.AppError) 420 ReloadConfig() error 421 RemoveBranchIcon(branchId string) *model.AppError 422 RemoveBranchMemberFromBranch(branchMember *model.BranchMember, requestorId string) *model.AppError 423 RemoveConfigListener(id string) 424 RemoveFile(path string) *model.AppError 425 RemoveLicense() *model.AppError 426 RemoveLicenseListener(id string) 427 RemoveSamlIdpCertificate() *model.AppError 428 RemoveSamlPrivateCertificate() *model.AppError 429 RemoveSamlPublicCertificate() *model.AppError 430 RemoveUserFromBranch(branchId string, userId string, requestorId string) *model.AppError 431 RemoveUserFromClass(userIdToRemove string, removerUserId string, class *model.Class) *model.AppError 432 RenameBranch(branch *model.Branch, newBranchName string, newDisplayName string) (*model.Branch, *model.AppError) 433 RenameClass(class *model.Class, newClassName string, newDisplayName string) (*model.Class, *model.AppError) 434 RequestId() string 435 ResetPasswordFromToken(userSuppliedTokenString, newPassword string) *model.AppError 436 ResetPermissionsSystem() *model.AppError 437 RestoreBranch(branchId string) *model.AppError 438 RestoreClass(class *model.Class, userId string) (*model.Class, *model.AppError) 439 RestrictUsersGetByPermissions(userId string, options *model.UserGetOptions) (*model.UserGetOptions, *model.AppError) 440 RestrictUsersSearchByPermissions(userId string, options *model.UserSearchOptions) (*model.UserSearchOptions, *model.AppError) 441 RevokeAccessToken(token string) *model.AppError 442 RevokeAllSessions(userId string) *model.AppError 443 RevokeSession(session *model.Session) *model.AppError 444 RevokeSessionById(sessionId string) *model.AppError 445 RevokeSessionsForDeviceId(userId string, deviceId string, currentSessionId string) *model.AppError 446 RevokeSessionsFromAllUsers() *model.AppError 447 RevokeUserAccessToken(token *model.UserAccessToken) *model.AppError 448 RolesGrantPermission(roleNames []string, permissionId string) bool 449 Saml() einterfaces.SamlInterface 450 SanitizeBranch(session model.Session, branch *model.Branch) *model.Branch 451 SanitizeBranches(session model.Session, branches []*model.Branch) []*model.Branch 452 SanitizeProfile(user *model.User, asAdmin bool) 453 SaveAndBroadcastStatus(status *model.Status) 454 SaveBrandImage(imageData *multipart.FileHeader) *model.AppError 455 SaveComplianceReport(job *model.Compliance) (*model.Compliance, *model.AppError) 456 SaveConfig(newCfg *model.Config, sendConfigChangeClusterMessage bool) *model.AppError 457 SaveLicense(licenseBytes []byte) (*model.License, *model.AppError) 458 SaveReactionForPost(reaction *model.Reaction) (*model.Reaction, *model.AppError) 459 SaveUserTermsOfService(userId, termsOfServiceId string, accepted bool) *model.AppError 460 SchemesIterator(scope string, batchSize int) func() []*model.Scheme 461 SearchEmoji(name string, prefixOnly bool, limit int) ([]*model.Emoji, *model.AppError) 462 SearchEngine() *searchengine.Broker 463 SearchUserAccessTokens(term string) ([]*model.UserAccessToken, *model.AppError) 464 SendAckToPushProxy(ack *model.PushNotificationAck) error 465 SendDailyDiagnostics() 466 SendDeactivateAccountEmail(email string, locale, siteURL string) *model.AppError 467 SendDiagnostic(event string, properties map[string]interface{}) 468 SendEmailVerification(user *model.User, newEmail string) *model.AppError 469 SendEphemeralPost(userId string, post *model.Post) *model.Post 470 SendInviteEmails(branch *model.Branch, senderName string, senderUserId string, invites []string, siteURL string) 471 SendNotifications(post *model.Post, branch *model.Branch, class *model.Class, sender *model.User, parentPostList *model.PostList) ([]string, error) 472 SendPasswordReset(email string, siteURL string) (bool, *model.AppError) 473 SendPasswordResetEmail(email string, token *model.Token, locale, siteURL string) (bool, *model.AppError) 474 SendSignInChangeEmail(email, method, locale, siteURL string) *model.AppError 475 ServerBusyStateChanged(sbs *model.ServerBusyState) 476 Session() *model.Session 477 SessionCacheLength() int 478 SessionHasPermissionTo(session model.Session, permission *model.Permission) bool 479 SessionHasPermissionToBranch(session model.Session, branchId string, permission *model.Permission) bool 480 SessionHasPermissionToClass(session model.Session, classId string, permission *model.Permission) bool 481 SessionHasPermissionToClassByPost(session model.Session, postId string, permission *model.Permission) bool 482 SessionHasPermissionToUser(session model.Session, userId string) bool 483 SetAcceptLanguage(s string) 484 SetActiveClass(userId string, classId string) *model.AppError 485 SetBranchIcon(branchId string, imageData *multipart.FileHeader) *model.AppError 486 SetBranchIconFromFile(branch *model.Branch, file io.Reader) *model.AppError 487 SetBranchIconFromMultiPartFile(branchId string, file multipart.File) *model.AppError 488 SetClientLicense(m map[string]string) 489 SetContext(c context.Context) 490 SetDefaultProfileImage(user *model.User) *model.AppError 491 SetDiagnosticId(id string) 492 SetIpAddress(s string) 493 SetLicense(license *model.License) bool 494 SetLog(l *mlog.Logger) 495 SetPath(s string) 496 SetPhase2PermissionsMigrationStatus(isComplete bool) error 497 SetProfileImage(userId string, imageData *multipart.FileHeader) *model.AppError 498 SetProfileImageFromFile(userId string, file io.Reader) *model.AppError 499 SetProfileImageFromMultiPartFile(userId string, file multipart.File) *model.AppError 500 SetRequestId(s string) 501 SetSamlIdpCertificateFromMetadata(data []byte) *model.AppError 502 SetSearchEngine(se *searchengine.Broker) 503 SetServer(srv *Server) 504 SetSession(s *model.Session) 505 SetStatusAwayIfNeeded(userId string, manual bool) 506 SetStatusDoNotDisturb(userId string) 507 SetStatusLastActivityAt(userId string, activityAt int64) 508 SetStatusOffline(userId string, manual bool) 509 SetStatusOnline(userId string, manual bool) 510 SetStatusOutOfOffice(userId string) 511 SetT(t goi18n.TranslateFunc) 512 SetUserAgent(s string) 513 SetupInviteEmailRateLimiting() error 514 Shutdown() 515 SoftDeleteBranch(branchId string) *model.AppError 516 Srv() *Server 517 StartPushNotificationsHubWorkers() 518 StopPushNotificationsHubWorkers() 519 SwitchEmailToLdap(email, password, code, ldapLoginId, ldapPassword string) (string, *model.AppError) 520 SwitchEmailToOAuth(w http.ResponseWriter, r *http.Request, email, password, code, service string) (string, *model.AppError) 521 SwitchLdapToEmail(ldapPassword, code, email, newPassword string) (string, *model.AppError) 522 SwitchOAuthToEmail(email, password, requesterId string) (string, *model.AppError) 523 SyncLdap() 524 T(translationID string, args ...interface{}) string 525 TestElasticsearch(cfg *model.Config) *model.AppError 526 TestEmail(userId string, cfg *model.Config) *model.AppError 527 TestLdap() *model.AppError 528 TestSiteURL(siteURL string) *model.AppError 529 Timezones() *timezones.Timezones 530 TotalWebsocketConnections() int 531 UpdateActive(user *model.User, active bool) (*model.User, *model.AppError) 532 UpdateBranch(branch *model.Branch) (*model.Branch, *model.AppError) 533 UpdateBranchMemberRoles(branchId string, userId string, newRoles string) (*model.BranchMember, *model.AppError) 534 UpdateBranchMemberSchemeRoles(branchId string, userId string, isSchemeUser bool, isSchemeAdmin bool) (*model.BranchMember, *model.AppError) 535 UpdateBranchScheme(branch *model.Branch) (*model.Branch, *model.AppError) 536 UpdateClass(class *model.Class) (*model.Class, *model.AppError) 537 UpdateClassMemberNotifyProps(data map[string]string, classId string, userId string) (*model.ClassMember, *model.AppError) 538 UpdateClassMemberRoles(classId string, userId string, newRoles string) (*model.ClassMember, *model.AppError) 539 UpdateClassMemberSchemeRoles(classId string, userId string, isSchemeUser bool, isSchemeAdmin bool) (*model.ClassMember, *model.AppError) 540 UpdateClassPrivacy(oldClass *model.Class, user *model.User) (*model.Class, *model.AppError) 541 UpdateClassScheme(class *model.Class) (*model.Class, *model.AppError) 542 UpdateCommand(oldCmd, updatedCmd *model.Command) (*model.Command, *model.AppError) 543 UpdateConfig(f func(*model.Config)) 544 UpdateEphemeralPost(userId string, post *model.Post) *model.Post 545 UpdateLastActivityAtIfNeeded(session model.Session) 546 UpdateMfa(activate bool, userId, token string) *model.AppError 547 UpdateMobileAppBadge(userId string) 548 UpdateOAuthUserAttrs(userData io.Reader, user *model.User, provider einterfaces.OauthProvider, service string) *model.AppError 549 UpdateOauthApp(oldApp, updatedApp *model.OAuthApp) (*model.OAuthApp, *model.AppError) 550 UpdatePassword(user *model.User, newPassword string) *model.AppError 551 UpdatePasswordAsUser(userId, currentPassword, newPassword string) *model.AppError 552 UpdatePasswordByUserIdSendEmail(userId, newPassword, method string) *model.AppError 553 UpdatePasswordSendEmail(user *model.User, newPassword, method string) *model.AppError 554 UpdatePost(post *model.Post, safeUpdate bool) (*model.Post, *model.AppError) 555 UpdatePreferences(userId string, preferences model.Preferences) *model.AppError 556 UpdateRole(role *model.Role) (*model.Role, *model.AppError) 557 UpdateScheme(scheme *model.Scheme) (*model.Scheme, *model.AppError) 558 UpdateSessionsIsGuest(userId string, isGuest bool) 559 UpdateUser(user *model.User, sendNotifications bool) (*model.User, *model.AppError) 560 UpdateUserActive(userId string, active bool) *model.AppError 561 UpdateUserAsUser(user *model.User, asAdmin bool) (*model.User, *model.AppError) 562 UpdateUserAuth(userId string, userAuth *model.UserAuth) (*model.UserAuth, *model.AppError) 563 UpdateUserNotifyProps(userId string, props map[string]string) (*model.User, *model.AppError) 564 UpdateUserRoles(userId string, newRoles string, sendWebSocketEvent bool) (*model.User, *model.AppError) 565 UpdateWebConnUserActivity(session model.Session, activityAt int64) 566 UploadEmojiImage(id string, imageData *multipart.FileHeader) *model.AppError 567 UploadFile(data []byte, classId string, filename string) (*model.FileInfo, *model.AppError) 568 UploadFileX(classId, name string, input io.Reader, opts ...func(*UploadFileTask)) (*model.FileInfo, *model.AppError) 569 UploadFiles(branchId string, classId string, userId string, files []io.ReadCloser, filenames []string, clientIds []string, now time.Time) (*model.FileUploadResponse, *model.AppError) 570 UploadMultipartFiles(branchId string, classId string, userId string, fileHeaders []*multipart.FileHeader, clientIds []string, now time.Time) (*model.FileUploadResponse, *model.AppError) 571 UserAgent() string 572 UserCanSeeOtherUser(userId string, otherUserId string) (bool, *model.AppError) 573 ValidateAndSetLicenseBytes(b []byte) 574 VerifyEmailFromToken(userSuppliedTokenString string) *model.AppError 575 VerifyUserEmail(userId, email string) *model.AppError 576 WaitForClassMembership(classId string, userId string) 577 WriteFile(fr io.Reader, path string) (int64, *model.AppError) 578 }