app

package
Version: v5.22.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2020 License: AGPL-3.0, Apache-2.0 Imports: 96 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DAY_MILLISECONDS   = 24 * 60 * 60 * 1000
	MONTH_MILLISECONDS = 31 * DAY_MILLISECONDS
)
View Source
const (
	RestLevelID        = 240
	RestContentLevelID = 241
	RestPermsLevelID   = 242
	CLILevelID         = 243
)
View Source
const (
	USER_PASSWORD           = "passwd"
	CHANNEL_TYPE            = model.CHANNEL_OPEN
	BTEST_TEAM_DISPLAY_NAME = "TestTeam"
	BTEST_TEAM_NAME         = "z-z-testdomaina"
	BTEST_TEAM_EMAIL        = "test@nowhere.com"
	BTEST_TEAM_TYPE         = model.TEAM_OPEN
	BTEST_USER_NAME         = "Mr. Testing Tester"
	BTEST_USER_EMAIL        = "success+ttester@simulator.amazonses.com"
	BTEST_USER_PASSWORD     = "passwd"
)
View Source
const (
	BRAND_FILE_PATH = "brand/"
	BRAND_FILE_NAME = "image.png"
)
View Source
const (
	CMD_EXPAND   = "expand"
	CMD_COLLAPSE = "collapse"
)
View Source
const (
	CMD_REMOVE = "remove"
	CMD_KICK   = "kick"
)
View Source
const (
	SEGMENT_KEY = "placeholder_segment_key"

	TRACK_CONFIG_SERVICE            = "config_service"
	TRACK_CONFIG_TEAM               = "config_team"
	TRACK_CONFIG_CLIENT_REQ         = "config_client_requirements"
	TRACK_CONFIG_SQL                = "config_sql"
	TRACK_CONFIG_LOG                = "config_log"
	TRACK_CONFIG_NOTIFICATION_LOG   = "config_notifications_log"
	TRACK_CONFIG_FILE               = "config_file"
	TRACK_CONFIG_RATE               = "config_rate"
	TRACK_CONFIG_EMAIL              = "config_email"
	TRACK_CONFIG_PRIVACY            = "config_privacy"
	TRACK_CONFIG_THEME              = "config_theme"
	TRACK_CONFIG_OAUTH              = "config_oauth"
	TRACK_CONFIG_LDAP               = "config_ldap"
	TRACK_CONFIG_COMPLIANCE         = "config_compliance"
	TRACK_CONFIG_LOCALIZATION       = "config_localization"
	TRACK_CONFIG_SAML               = "config_saml"
	TRACK_CONFIG_PASSWORD           = "config_password"
	TRACK_CONFIG_CLUSTER            = "config_cluster"
	TRACK_CONFIG_METRICS            = "config_metrics"
	TRACK_CONFIG_SUPPORT            = "config_support"
	TRACK_CONFIG_NATIVEAPP          = "config_nativeapp"
	TRACK_CONFIG_EXPERIMENTAL       = "config_experimental"
	TRACK_CONFIG_ANALYTICS          = "config_analytics"
	TRACK_CONFIG_ANNOUNCEMENT       = "config_announcement"
	TRACK_CONFIG_ELASTICSEARCH      = "config_elasticsearch"
	TRACK_CONFIG_PLUGIN             = "config_plugin"
	TRACK_CONFIG_DATA_RETENTION     = "config_data_retention"
	TRACK_CONFIG_MESSAGE_EXPORT     = "config_message_export"
	TRACK_CONFIG_DISPLAY            = "config_display"
	TRACK_CONFIG_GUEST_ACCOUNTS     = "config_guest_accounts"
	TRACK_CONFIG_IMAGE_PROXY        = "config_image_proxy"
	TRACK_PERMISSIONS_GENERAL       = "permissions_general"
	TRACK_PERMISSIONS_SYSTEM_SCHEME = "permissions_system_scheme"
	TRACK_PERMISSIONS_TEAM_SCHEMES  = "permissions_team_schemes"
	TRACK_ELASTICSEARCH             = "elasticsearch"
	TRACK_GROUPS                    = "groups"
	TRACK_CHANNEL_MODERATION        = "channel_moderation"

	TRACK_ACTIVITY = "activity"
	TRACK_LICENSE  = "license"
	TRACK_SERVER   = "server"
	TRACK_PLUGINS  = "plugins"
)
View Source
const (
	MaxEmojiFileSize       = 1 << 20 // 1 MB
	MaxEmojiWidth          = 128
	MaxEmojiHeight         = 128
	MaxEmojiOriginalWidth  = 1028
	MaxEmojiOriginalHeight = 1028
)
View Source
const (
	/*
	  EXIF Image Orientations
	  1        2       3      4         5            6           7          8

	  888888  888888      88  88      8888888888  88                  88  8888888888
	  88          88      88  88      88  88      88  88          88  88      88  88
	  8888      8888    8888  8888    88          8888888888  8888888888          88
	  88          88      88  88
	  88          88  888888  888888
	*/
	Upright            = 1
	UprightMirrored    = 2
	UpsideDown         = 3
	UpsideDownMirrored = 4
	RotatedCWMirrored  = 5
	RotatedCCW         = 6
	RotatedCCWMirrored = 7
	RotatedCW          = 8

	MaxImageSize         = 6048 * 4032 // 24 megapixels, roughly 36MB as a raw image
	ImageThumbnailWidth  = 120
	ImageThumbnailHeight = 100
	ImageThumbnailRatio  = float64(ImageThumbnailHeight) / float64(ImageThumbnailWidth)
	ImagePreviewWidth    = 1920

	UploadFileInitialBufferSize = 2 * 1024 * 1024 // 2Mb

	// Deprecated
	IMAGE_THUMBNAIL_PIXEL_WIDTH  = 120
	IMAGE_THUMBNAIL_PIXEL_HEIGHT = 100
	IMAGE_PREVIEW_PIXEL_WIDTH    = 1920
)
View Source
const (
	OAUTH_COOKIE_MAX_AGE_SECONDS = 30 * 60 // 30 minutes
	COOKIE_OAUTH                 = "MMOAUTH"
)
View Source
const (
	PERMISSION_MANAGE_SYSTEM                     = "manage_system"
	PERMISSION_MANAGE_EMOJIS                     = "manage_emojis"
	PERMISSION_MANAGE_OTHERS_EMOJIS              = "manage_others_emojis"
	PERMISSION_CREATE_EMOJIS                     = "create_emojis"
	PERMISSION_DELETE_EMOJIS                     = "delete_emojis"
	PERMISSION_DELETE_OTHERS_EMOJIS              = "delete_others_emojis"
	PERMISSION_MANAGE_WEBHOOKS                   = "manage_webhooks"
	PERMISSION_MANAGE_OTHERS_WEBHOOKS            = "manage_others_webhooks"
	PERMISSION_MANAGE_INCOMING_WEBHOOKS          = "manage_incoming_webhooks"
	PERMISSION_MANAGE_OTHERS_INCOMING_WEBHOOKS   = "manage_others_incoming_webhooks"
	PERMISSION_MANAGE_OUTGOING_WEBHOOKS          = "manage_outgoing_webhooks"
	PERMISSION_MANAGE_OTHERS_OUTGOING_WEBHOOKS   = "manage_others_outgoing_webhooks"
	PERMISSION_LIST_PUBLIC_TEAMS                 = "list_public_teams"
	PERMISSION_LIST_PRIVATE_TEAMS                = "list_private_teams"
	PERMISSION_JOIN_PUBLIC_TEAMS                 = "join_public_teams"
	PERMISSION_JOIN_PRIVATE_TEAMS                = "join_private_teams"
	PERMISSION_PERMANENT_DELETE_USER             = "permanent_delete_user"
	PERMISSION_CREATE_BOT                        = "create_bot"
	PERMISSION_READ_BOTS                         = "read_bots"
	PERMISSION_READ_OTHERS_BOTS                  = "read_others_bots"
	PERMISSION_MANAGE_BOTS                       = "manage_bots"
	PERMISSION_MANAGE_OTHERS_BOTS                = "manage_others_bots"
	PERMISSION_DELETE_PUBLIC_CHANNEL             = "delete_public_channel"
	PERMISSION_DELETE_PRIVATE_CHANNEL            = "delete_private_channel"
	PERMISSION_MANAGE_PUBLIC_CHANNEL_PROPERTIES  = "manage_public_channel_properties"
	PERMISSION_MANAGE_PRIVATE_CHANNEL_PROPERTIES = "manage_private_channel_properties"
	PERMISSION_VIEW_MEMBERS                      = "view_members"
	PERMISSION_INVITE_USER                       = "invite_user"
	PERMISSION_INVITE_GUEST                      = "invite_guest"
	PERMISSION_PROMOTE_GUEST                     = "promote_guest"
	PERMISSION_DEMOTE_TO_GUEST                   = "demote_to_guest"
	PERMISSION_USE_CHANNEL_MENTIONS              = "use_channel_mentions"
	PERMISSION_CREATE_POST                       = "create_post"
	PERMISSION_CREATE_POST_PUBLIC                = "create_post_public"
	PERMISSION_USE_GROUP_MENTIONS                = "use_group_mentions"
	PERMISSION_ADD_REACTION                      = "add_reaction"
	PERMISSION_REMOVE_REACTION                   = "remove_reaction"
	PERMISSION_MANAGE_PUBLIC_CHANNEL_MEMBERS     = "manage_public_channel_members"
	PERMISSION_MANAGE_PRIVATE_CHANNEL_MEMBERS    = "manage_private_channel_members"
)
View Source
const (
	SamlPublicCertificateName = "saml-public.crt"
	SamlPrivateKeyName        = "saml-private.key"
	SamlIdpCertificateName    = "saml-idp.crt"
)
View Source
const (
	SECURITY_URL           = "https://securityupdatecheck.mattermost.com"
	SECURITY_UPDATE_PERIOD = 86400000 // 24 hours in milliseconds.

	PROP_SECURITY_ID                = "id"
	PROP_SECURITY_BUILD             = "b"
	PROP_SECURITY_ENTERPRISE_READY  = "be"
	PROP_SECURITY_DATABASE          = "db"
	PROP_SECURITY_OS                = "os"
	PROP_SECURITY_USER_COUNT        = "uc"
	PROP_SECURITY_TEAM_COUNT        = "tc"
	PROP_SECURITY_ACTIVE_USER_COUNT = "auc"
	PROP_SECURITY_UNIT_TESTS        = "ut"
)
View Source
const (
	TOKEN_TYPE_PASSWORD_RECOVERY  = "password_recovery"
	TOKEN_TYPE_VERIFY_EMAIL       = "verify_email"
	TOKEN_TYPE_TEAM_INVITATION    = "team_invitation"
	TOKEN_TYPE_GUEST_INVITATION   = "guest_invitation"
	PASSWORD_RECOVER_EXPIRY_TIME  = 1000 * 60 * 60      // 1 hour
	INVITATION_EXPIRY_TIME        = 1000 * 60 * 60 * 48 // 48 hours
	IMAGE_PROFILE_PIXEL_DIMENSION = 128
)
View Source
const (
	SEND_QUEUE_SIZE           = 256
	SEND_SLOW_WARN            = (SEND_QUEUE_SIZE * 50) / 100
	SEND_DEADLOCK_WARN        = (SEND_QUEUE_SIZE * 95) / 100
	WRITE_WAIT                = 30 * time.Second
	PONG_WAIT                 = 100 * time.Second
	PING_PERIOD               = (PONG_WAIT * 6) / 10
	AUTH_TIMEOUT              = 5 * time.Second
	WEBCONN_MEMBER_CACHE_TIME = 1000 * 60 * 30 // 30 minutes
)
View Source
const (
	BROADCAST_QUEUE_SIZE = 4096
	DEADLOCK_TICKER      = 15 * time.Second                  // check every 15 seconds
	DEADLOCK_WARN        = (BROADCAST_QUEUE_SIZE * 99) / 100 // number of buffered messages before printing stack trace
)
View Source
const (
	TRIGGERWORDS_EXACT_MATCH = 0
	TRIGGERWORDS_STARTS_WITH = 1

	MaxIntegrationResponseSize = 1024 * 1024 // Posts can be <100KB at most, so this is likely more than enough
)
View Source
const ADVANCED_PERMISSIONS_MIGRATION_KEY = "AdvancedPermissionsMigrationComplete"
View Source
const (
	CMD_AWAY = "away"
)
View Source
const (
	CMD_CODE = "code"
)
View Source
const (
	CMD_DND = "dnd"
)
View Source
const (
	CMD_ECHO = "echo"
)
View Source
const (
	CMD_GROUPMSG = "groupmsg"
)
View Source
const (
	CMD_HELP = "help"
)
View Source
const (
	CMD_INVITE = "invite"
)
View Source
const (
	CMD_INVITE_PEOPLE = "invite_people"
)
View Source
const (
	CMD_JOIN = "join"
)
View Source
const (
	CMD_LEAVE = "leave"
)
View Source
const (
	CMD_LOGOUT = "logout"
)
View Source
const (
	CMD_ME = "me"
)
View Source
const (
	CMD_MSG = "msg"
)
View Source
const (
	CMD_MUTE = "mute"
)
View Source
const (
	CMD_OFFLINE = "offline"
)
View Source
const (
	CMD_ONLINE = "online"
)
View Source
const (
	CMD_OPEN = "open"
)
View Source
const (
	CMD_SEARCH = "search"
)
View Source
const (
	CMD_SETTINGS = "settings"
)
View Source
const (
	CMD_SHORTCUTS = "shortcuts"
)
View Source
const (
	CMD_SHRUG = "shrug"
)
View Source
const (
	CMD_TEST = "test"
)
View Source
const (
	DISCOVERY_SERVICE_WRITE_PING = 60 * time.Second
)
View Source
const (
	EMAIL_BATCHING_TASK_NAME = "Email Batching"
)
View Source
const EMOJIS_PERMISSIONS_MIGRATION_KEY = "EmojisPermissionsMigrationComplete"
View Source
const (
	ERROR_TERMS_OF_SERVICE_NO_ROWS_FOUND = "store.sql_terms_of_service_store.get.no_rows.app_error"
)
View Source
const GUEST_ROLES_CREATION_MIGRATION_KEY = "GuestRolesCreationMigrationComplete"
View Source
const (
	// HTTP_REQUEST_TIMEOUT defines a high timeout for downloading large files
	// from an external URL to avoid slow connections from failing to install.
	HTTP_REQUEST_TIMEOUT = 1 * time.Hour
)
View Source
const MaxOpenGraphResponseSize = 1024 * 1024 * 50
View Source
const PUSH_NOTIFICATIONS_HUB_BUFFER_PER_WORKER = 50
View Source
const PUSH_NOTIFICATION_HUB_WORKERS = 1000
View Source
const (
	SESSIONS_CLEANUP_BATCH_SIZE = 1000
)
View Source
const SLACK_IMPORT_MAX_FILE_SIZE = 1024 * 1024 * 70
View Source
const (
	TIMESTAMP_FORMAT = "Mon Jan 2 15:04:05 -0700 MST 2006"
)
View Source
const TIME_TO_WAIT_FOR_CONNECTIONS_TO_CLOSE_ON_SERVER_SHUTDOWN = time.Second

Variables

View Source
var (
	RestLevel        = audit.Level{ID: RestLevelID, Name: "audit-rest", Stacktrace: false}
	RestContentLevel = audit.Level{ID: RestContentLevelID, Name: "audit-rest-content", Stacktrace: false}
	RestPermsLevel   = audit.Level{ID: RestPermsLevelID, Name: "audit-rest-perms", Stacktrace: false}
	CLILevel         = audit.Level{ID: CLILevelID, Name: "audit-cli", Stacktrace: false}
)
View Source
var (
	TEAM_NAME_LEN            = utils.Range{Begin: 10, End: 20}
	TEAM_DOMAIN_NAME_LEN     = utils.Range{Begin: 10, End: 20}
	TEAM_EMAIL_LEN           = utils.Range{Begin: 15, End: 30}
	USER_NAME_LEN            = utils.Range{Begin: 5, End: 20}
	USER_EMAIL_LEN           = utils.Range{Begin: 15, End: 30}
	CHANNEL_DISPLAY_NAME_LEN = utils.Range{Begin: 10, End: 20}
	CHANNEL_NAME_LEN         = utils.Range{Begin: 5, End: 20}
	TEST_IMAGE_FILENAMES     = []string{"test.png", "testjpg.jpg", "testgif.gif"}
)
View Source
var MaxNotificationsPerChannelDefault int64 = 1000000

Functions

func CheckEmailDomain

func CheckEmailDomain(email string, domains string) bool

CheckEmailDomain checks that an email domain matches a list of space-delimited domains as a string.

func CheckUserDomain

func CheckUserDomain(user *model.User, domains string) bool

CheckUserDomain checks that a user's email domain matches a list of space-delimited domains as a string.

func CreateProfileImage

func CreateProfileImage(username string, userId string, initialFont string) ([]byte, *model.AppError)

func DoesNotifyPropsAllowPushNotification

func DoesNotifyPropsAllowPushNotification(user *model.User, channelNotifyProps model.StringMap, post *model.Post, wasMentioned bool) bool

func DoesStatusAllowPushNotification

func DoesStatusAllowPushNotification(userNotifyProps model.StringMap, status *model.Status, channelId string) bool

func GeneratePublicLinkHash

func GeneratePublicLinkHash(fileId, salt string) string

func GetProtocol

func GetProtocol(r *http.Request) string

func JoinCluster

func JoinCluster(s *Server) error

func RegisterAccountMigrationInterface

func RegisterAccountMigrationInterface(f func(*Server) einterfaces.AccountMigrationInterface)

func RegisterClusterInterface

func RegisterClusterInterface(f func(*Server) einterfaces.ClusterInterface)

func RegisterCommandProvider

func RegisterCommandProvider(newProvider CommandProvider)

func RegisterComplianceInterface

func RegisterComplianceInterface(f func(*Server) einterfaces.ComplianceInterface)

func RegisterDataRetentionInterface

func RegisterDataRetentionInterface(f func(*Server) einterfaces.DataRetentionInterface)

func RegisterElasticsearchInterface

func RegisterElasticsearchInterface(f func(*Server) searchengine.SearchEngineInterface)

func RegisterJobsDataRetentionJobInterface

func RegisterJobsDataRetentionJobInterface(f func(*Server) ejobs.DataRetentionJobInterface)

func RegisterJobsElasticsearchAggregatorInterface

func RegisterJobsElasticsearchAggregatorInterface(f func(*Server) ejobs.ElasticsearchAggregatorInterface)

func RegisterJobsElasticsearchIndexerInterface

func RegisterJobsElasticsearchIndexerInterface(f func(*Server) ejobs.ElasticsearchIndexerInterface)

func RegisterJobsLdapSyncInterface

func RegisterJobsLdapSyncInterface(f func(*App) ejobs.LdapSyncInterface)

func RegisterJobsMessageExportJobInterface

func RegisterJobsMessageExportJobInterface(f func(*Server) ejobs.MessageExportJobInterface)

func RegisterJobsMigrationsJobInterface

func RegisterJobsMigrationsJobInterface(f func(*App) tjobs.MigrationsJobInterface)

func RegisterJobsPluginsJobInterface

func RegisterJobsPluginsJobInterface(f func(*App) tjobs.PluginsJobInterface)

func RegisterLdapInterface

func RegisterLdapInterface(f func(*App) einterfaces.LdapInterface)

func RegisterMessageExportInterface

func RegisterMessageExportInterface(f func(*Server) einterfaces.MessageExportInterface)

func RegisterMetricsInterface

func RegisterMetricsInterface(f func(*Server) einterfaces.MetricsInterface)

func RegisterNewSamlInterface

func RegisterNewSamlInterface(f func(*App) einterfaces.SamlInterface)

func RegisterNotificationInterface

func RegisterNotificationInterface(f func(*App) einterfaces.NotificationInterface)

func RegisterSamlInterface

func RegisterSamlInterface(f func(*App) einterfaces.SamlInterface)

func RemoveRoles

func RemoveRoles(rolesToRemove []string, roles string) string

func ReturnWebSocketError

func ReturnWebSocketError(conn *WebConn, r *model.WebSocketRequest, err *model.AppError)

func RunJobs

func RunJobs(s *Server) error

func ShouldSendPushNotification

func ShouldSendPushNotification(user *model.User, channelNotifyProps model.StringMap, wasMentioned bool, status *model.Status, post *model.Post) bool

func SlackConvertChannelMentions

func SlackConvertChannelMentions(channels []SlackChannel, posts map[string][]SlackPost) map[string][]SlackPost

func SlackConvertChannelName

func SlackConvertChannelName(channelName string, channelId string) string

func SlackConvertPostsMarkup

func SlackConvertPostsMarkup(posts map[string][]SlackPost) map[string][]SlackPost

func SlackConvertTimeStamp

func SlackConvertTimeStamp(ts string) int64

func SlackConvertUserMentions

func SlackConvertUserMentions(users []SlackUser, posts map[string][]SlackPost) map[string][]SlackPost

func SlackSanitiseChannelProperties

func SlackSanitiseChannelProperties(channel model.Channel) model.Channel

func SplitWebhookPost

func SplitWebhookPost(post *model.Post, maxPostSize int) ([]*model.Post, *model.AppError)

func StartMetrics

func StartMetrics(s *Server) error

func StartSearchEngine

func StartSearchEngine(s *Server) error

func UploadFileSetClientId

func UploadFileSetClientId(clientId string) func(t *UploadFileTask)

func UploadFileSetContentLength

func UploadFileSetContentLength(contentLength int64) func(t *UploadFileTask)

func UploadFileSetRaw

func UploadFileSetRaw() func(t *UploadFileTask)

func UploadFileSetTeamId

func UploadFileSetTeamId(teamId string) func(t *UploadFileTask)

func UploadFileSetTimestamp

func UploadFileSetTimestamp(timestamp time.Time) func(t *UploadFileTask)

func UploadFileSetUserId

func UploadFileSetUserId(userId string) func(t *UploadFileTask)

Types

type App

type App struct {
	// contains filtered or unexported fields
}

func New

func New(options ...AppOption) *App

func (*App) AcceptLanguage

func (a *App) AcceptLanguage() string

func (*App) AccountMigration

func (a *App) AccountMigration() einterfaces.AccountMigrationInterface

func (*App) ActivateMfa

func (a *App) ActivateMfa(userId, token string) *model.AppError

func (*App) AddConfigListener

func (a *App) AddConfigListener(listener func(*model.Config, *model.Config)) string

func (*App) AddLicenseListener

func (a *App) AddLicenseListener(listener func(oldLicense, newLicense *model.License)) string

func (*App) AddNotificationEmailToBatch

func (a *App) AddNotificationEmailToBatch(user *model.User, post *model.Post, team *model.Team) *model.AppError

func (*App) AddSamlIdpCertificate

func (a *App) AddSamlIdpCertificate(fileData *multipart.FileHeader) *model.AppError

func (*App) AddSamlPrivateCertificate

func (a *App) AddSamlPrivateCertificate(fileData *multipart.FileHeader) *model.AppError

func (*App) AddSamlPublicCertificate

func (a *App) AddSamlPublicCertificate(fileData *multipart.FileHeader) *model.AppError

func (*App) AddSessionToCache

func (a *App) AddSessionToCache(session *model.Session)

func (*App) AddStatusCache

func (a *App) AddStatusCache(status *model.Status)

func (*App) AddStatusCacheSkipClusterSend

func (a *App) AddStatusCacheSkipClusterSend(status *model.Status)

func (*App) AllowOAuthAppAccessToUser

func (a *App) AllowOAuthAppAccessToUser(userId string, authRequest *model.AuthorizeRequest) (string, *model.AppError)

func (*App) AsymmetricSigningKey

func (a *App) AsymmetricSigningKey() *ecdsa.PrivateKey

func (*App) AttachDeviceId

func (a *App) AttachDeviceId(sessionId string, deviceId string, expiresAt int64) *model.AppError

func (*App) AttachSessionCookies

func (a *App) AttachSessionCookies(w http.ResponseWriter, r *http.Request)

func (*App) AuthenticateUserForLogin

func (a *App) AuthenticateUserForLogin(id, loginId, password, mfaToken string, ldapOnly bool) (user *model.User, err *model.AppError)

func (*App) AuthorizeOAuthUser

func (a *App) AuthorizeOAuthUser(w http.ResponseWriter, r *http.Request, service, code, state, redirectUri string) (io.ReadCloser, string, map[string]string, *model.AppError)

func (*App) AutocompleteUsersInChannel

func (a *App) AutocompleteUsersInChannel(teamId string, channelId string, term string, options *model.UserSearchOptions) (*model.UserAutocompleteInChannel, *model.AppError)

func (*App) AutocompleteUsersInTeam

func (a *App) AutocompleteUsersInTeam(teamId string, term string, options *model.UserSearchOptions) (*model.UserAutocompleteInTeam, *model.AppError)

func (*App) BroadcastStatus

func (a *App) BroadcastStatus(status *model.Status)

func (*App) BuildPostReactions

func (a *App) BuildPostReactions(postId string) (*[]ReactionImportData, *model.AppError)

func (*App) BuildPushNotificationMessage

func (a *App) BuildPushNotificationMessage(contentsConfig string, post *model.Post, user *model.User, channel *model.Channel, channelName string, senderName string,
	explicitMention bool, channelWideMention bool, replyToThreadType string) (*model.PushNotification, *model.AppError)

func (*App) BuildSamlMetadataObject

func (a *App) BuildSamlMetadataObject(idpMetadata []byte) (*model.SamlMetadataResponse, *model.AppError)

func (*App) BulkExport

func (a *App) BulkExport(writer io.Writer, file string, pathToEmojiDir string, dirNameToExportEmoji string) *model.AppError

func (*App) BulkImport

func (a *App) BulkImport(fileReader io.Reader, dryRun bool, workers int) (*model.AppError, int)

func (*App) CancelJob

func (a *App) CancelJob(jobId string) *model.AppError

func (*App) CheckForClientSideCert

func (a *App) CheckForClientSideCert(r *http.Request) (string, string, string)

func (*App) CheckPasswordAndAllCriteria

func (a *App) CheckPasswordAndAllCriteria(user *model.User, password string, mfaToken string) *model.AppError

func (*App) CheckRolesExist

func (a *App) CheckRolesExist(roleNames []string) *model.AppError

func (*App) CheckUserAllAuthenticationCriteria

func (a *App) CheckUserAllAuthenticationCriteria(user *model.User, mfaToken string) *model.AppError

func (*App) CheckUserMfa

func (a *App) CheckUserMfa(user *model.User, token string) *model.AppError

func (*App) CheckUserPostflightAuthenticationCriteria

func (a *App) CheckUserPostflightAuthenticationCriteria(user *model.User) *model.AppError

func (*App) CheckUserPreflightAuthenticationCriteria

func (a *App) CheckUserPreflightAuthenticationCriteria(user *model.User, mfaToken string) *model.AppError

func (*App) ClearSessionCacheForAllUsers

func (a *App) ClearSessionCacheForAllUsers()

func (*App) ClearSessionCacheForAllUsersSkipClusterSend

func (a *App) ClearSessionCacheForAllUsersSkipClusterSend()

func (*App) ClearSessionCacheForUser

func (a *App) ClearSessionCacheForUser(userId string)

func (*App) ClearSessionCacheForUserSkipClusterSend

func (a *App) ClearSessionCacheForUserSkipClusterSend(userId string)

func (*App) ClientConfig

func (a *App) ClientConfig() map[string]string

func (*App) ClientConfigHash

func (a *App) ClientConfigHash() string

func (*App) ClientConfigWithComputed

func (a *App) ClientConfigWithComputed() map[string]string

ClientConfigWithComputed gets the configuration in a format suitable for sending to the client.

func (*App) ClientLicense

func (a *App) ClientLicense() map[string]string

func (*App) Cluster

func (a *App) Cluster() einterfaces.ClusterInterface

func (*App) CompleteOAuth

func (a *App) CompleteOAuth(service string, body io.ReadCloser, teamId string, props map[string]string) (*model.User, *model.AppError)

func (*App) CompleteSwitchWithOAuth

func (a *App) CompleteSwitchWithOAuth(service string, userData io.Reader, email string) (*model.User, *model.AppError)

func (*App) Compliance

func (a *App) Compliance() einterfaces.ComplianceInterface

func (*App) Config

func (a *App) Config() *model.Config

func (*App) Context

func (a *App) Context() context.Context

func (*App) CopyFileInfos

func (a *App) CopyFileInfos(userId string, fileIds []string) ([]string, *model.AppError)

func (*App) CreateBasicUser

func (a *App) CreateBasicUser(client *model.Client4) *model.AppError

Basic test team and user so you always know one

func (*App) CreateCommand

func (a *App) CreateCommand(cmd *model.Command) (*model.Command, *model.AppError)

func (*App) CreateCommandPost

func (a *App) CreateCommandPost(post *model.Post, teamId string, response *model.CommandResponse, skipSlackParsing bool) (*model.Post, *model.AppError)

@openTracingParams teamId, skipSlackParsing

func (*App) CreateCommandWebhook

func (a *App) CreateCommandWebhook(commandId string, args *model.CommandArgs) (*model.CommandWebhook, *model.AppError)

func (*App) CreateDefaultMemberships

func (a *App) CreateDefaultMemberships(since int64) error

CreateDefaultMemberships adds users to teams and channels based on their group memberships and how those groups are configured to sync with teams and channels for group members on or after the given timestamp.

func (*App) CreateEmoji

func (a *App) CreateEmoji(sessionUserId string, emoji *model.Emoji, multiPartImageData *multipart.Form) (*model.Emoji, *model.AppError)

func (*App) CreateGuest

func (a *App) CreateGuest(user *model.User) (*model.User, *model.AppError)

CreateGuest creates a guest and sets several fields of the returned User struct to their zero values.

func (*App) CreateIncomingWebhookForChannel

func (a *App) CreateIncomingWebhookForChannel(creatorId string, channel *model.Channel, hook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError)

func (*App) CreateJob

func (a *App) CreateJob(job *model.Job) (*model.Job, *model.AppError)

func (*App) CreateOAuthApp

func (a *App) CreateOAuthApp(app *model.OAuthApp) (*model.OAuthApp, *model.AppError)

func (*App) CreateOAuthStateToken

func (a *App) CreateOAuthStateToken(extra string) (*model.Token, *model.AppError)

func (*App) CreateOAuthUser

func (a *App) CreateOAuthUser(service string, userData io.Reader, teamId string) (*model.User, *model.AppError)

func (*App) CreateOutgoingWebhook

func (a *App) CreateOutgoingWebhook(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError)

func (*App) CreatePasswordRecoveryToken

func (a *App) CreatePasswordRecoveryToken(userId, email string) (*model.Token, *model.AppError)

func (*App) CreateRole

func (a *App) CreateRole(role *model.Role) (*model.Role, *model.AppError)

func (*App) CreateScheme

func (a *App) CreateScheme(scheme *model.Scheme) (*model.Scheme, *model.AppError)

func (*App) CreateSession

func (a *App) CreateSession(session *model.Session) (*model.Session, *model.AppError)

func (*App) CreateTermsOfService

func (a *App) CreateTermsOfService(text, userId string) (*model.TermsOfService, *model.AppError)

func (*App) CreateUser

func (a *App) CreateUser(user *model.User) (*model.User, *model.AppError)

CreateUser creates a user and sets several fields of the returned User struct to their zero values.

func (*App) CreateUserAccessToken

func (a *App) CreateUserAccessToken(token *model.UserAccessToken) (*model.UserAccessToken, *model.AppError)

func (*App) CreateUserAsAdmin

func (a *App) CreateUserAsAdmin(user *model.User) (*model.User, *model.AppError)

func (*App) CreateUserFromSignup

func (a *App) CreateUserFromSignup(user *model.User) (*model.User, *model.AppError)

func (*App) CreateUserWithInviteId

func (a *App) CreateUserWithInviteId(user *model.User, inviteId string) (*model.User, *model.AppError)

func (*App) CreateUserWithToken

func (a *App) CreateUserWithToken(user *model.User, token *model.Token) (*model.User, *model.AppError)

func (*App) CreateVerifyEmailToken

func (a *App) CreateVerifyEmailToken(userId string, newEmail string) (*model.Token, *model.AppError)

func (*App) CreateWebhookPost

func (a *App) CreateWebhookPost(userId string, channel *model.Channel, text, overrideUsername, overrideIconUrl, overrideIconEmoji string, props model.StringInterface, postType string, postRootId string) (*model.Post, *model.AppError)

func (*App) DataRetention

func (a *App) DataRetention() einterfaces.DataRetentionInterface

func (*App) DeactivateGuests

func (a *App) DeactivateGuests() *model.AppError

func (*App) DeactivateMfa

func (a *App) DeactivateMfa(userId string) *model.AppError

func (*App) DeauthorizeOAuthAppForUser

func (a *App) DeauthorizeOAuthAppForUser(userId, appId string) *model.AppError

func (*App) DeleteBrandImage

func (a *App) DeleteBrandImage() *model.AppError

func (*App) DeleteCommand

func (a *App) DeleteCommand(commandId string) *model.AppError

func (*App) DeleteEmoji

func (a *App) DeleteEmoji(emoji *model.Emoji) *model.AppError

func (*App) DeleteGroupConstrainedMemberships

func (a *App) DeleteGroupConstrainedMemberships() error

DeleteGroupConstrainedMemberships deletes team and channel memberships of users who aren't members of the allowed groups of all group-constrained teams and channels.

func (*App) DeleteIncomingWebhook

func (a *App) DeleteIncomingWebhook(hookId string) *model.AppError

func (*App) DeleteOAuthApp

func (a *App) DeleteOAuthApp(appId string) *model.AppError

func (*App) DeleteOutgoingWebhook

func (a *App) DeleteOutgoingWebhook(hookId string) *model.AppError

func (*App) DeletePreferences

func (a *App) DeletePreferences(userId string, preferences model.Preferences) *model.AppError

func (*App) DeleteReactionForPost

func (a *App) DeleteReactionForPost(reaction *model.Reaction) *model.AppError

func (*App) DeleteScheme

func (a *App) DeleteScheme(schemeId string) (*model.Scheme, *model.AppError)

func (*App) DeleteToken

func (a *App) DeleteToken(token *model.Token) *model.AppError

func (*App) DemoteUserToGuest

func (a *App) DemoteUserToGuest(user *model.User) *model.AppError

DemoteUserToGuest Convert user's roles and all his mermbership's roles from regular user roles to guest roles.

func (*App) DiagnosticId

func (a *App) DiagnosticId() string

func (*App) DisableAutoResponder

func (a *App) DisableAutoResponder(userId string, asAdmin bool) *model.AppError

func (*App) DisableUserAccessToken

func (a *App) DisableUserAccessToken(token *model.UserAccessToken) *model.AppError

func (*App) DoActionRequest

func (a *App) DoActionRequest(rawURL string, body []byte) (*http.Response, *model.AppError)

Perform an HTTP POST request to an integration's action endpoint. Caller must consume and close returned http.Response as necessary. For internal requests, requests are routed directly to a plugin ServerHTTP hook

func (*App) DoAdvancedPermissionsMigration

func (a *App) DoAdvancedPermissionsMigration()

This function migrates the default built in roles from code/config to the database.

func (*App) DoAppMigrations

func (a *App) DoAppMigrations()

func (*App) DoEmojisPermissionsMigration

func (a *App) DoEmojisPermissionsMigration()

func (*App) DoGuestRolesCreationMigration

func (a *App) DoGuestRolesCreationMigration()

func (*App) DoLocalRequest

func (a *App) DoLocalRequest(rawURL string, body []byte) (*http.Response, *model.AppError)

func (*App) DoLogin

func (a *App) DoLogin(w http.ResponseWriter, r *http.Request, user *model.User, deviceId string) *model.AppError

func (*App) DoPermissionsMigrations

func (a *App) DoPermissionsMigrations() error

DoPermissionsMigrations execute all the permissions migrations need by the current version.

func (*App) DoPostAction

func (a *App) DoPostAction(postId, actionId, userId, selectedOption string) (string, *model.AppError)

func (*App) DoPostActionWithCookie

func (a *App) DoPostActionWithCookie(postId, actionId, userId, selectedOption string, cookie *model.PostActionCookie) (string, *model.AppError)

func (*App) DoUploadFile

func (a *App) DoUploadFile(now time.Time, rawTeamId string, rawChannelId string, rawUserId string, rawFilename string, data []byte) (*model.FileInfo, *model.AppError)

func (*App) DoUploadFileExpectModification

func (a *App) DoUploadFileExpectModification(now time.Time, rawTeamId string, rawChannelId string, rawUserId string, rawFilename string, data []byte) (*model.FileInfo, []byte, *model.AppError)

func (*App) DoubleCheckPassword

func (a *App) DoubleCheckPassword(user *model.User, password string) *model.AppError

This to be used for places we check the users password when they are already logged in

func (*App) DownloadFromURL

func (a *App) DownloadFromURL(downloadURL string) ([]byte, error)

func (*App) EnableUserAccessToken

func (a *App) EnableUserAccessToken(token *model.UserAccessToken) *model.AppError

func (*App) EnvironmentConfig

func (a *App) EnvironmentConfig() map[string]interface{}

func (*App) ExecuteCommand

func (a *App) ExecuteCommand(args *model.CommandArgs) (*model.CommandResponse, *model.AppError)

@openTracingParams args

func (*App) ExportPermissions

func (a *App) ExportPermissions(w io.Writer) error

func (*App) FetchSamlMetadataFromIdp

func (a *App) FetchSamlMetadataFromIdp(url string) ([]byte, *model.AppError)

func (*App) FileBackend

func (a *App) FileBackend() (filesstore.FileBackend, *model.AppError)

func (*App) FileExists

func (a *App) FileExists(path string) (bool, *model.AppError)

func (*App) FileReader

func (a *App) FileReader(path string) (filesstore.ReadCloseSeeker, *model.AppError)

Caller must close the first return value

func (*App) FilterNonGroupChannelMembers

func (a *App) FilterNonGroupChannelMembers(userIds []string, channel *model.Channel) ([]string, error)

FilterNonGroupChannelMembers returns the subset of the given user IDs of the users who are not members of groups associated to the channel excluding bots

func (*App) FilterNonGroupTeamMembers

func (a *App) FilterNonGroupTeamMembers(userIds []string, team *model.Team) ([]string, error)

FilterNonGroupTeamMembers returns the subset of the given user IDs of the users who are not members of groups associated to the team excluding bots.

func (*App) GenerateMfaSecret

func (a *App) GenerateMfaSecret(userId string) (*model.MfaSecret, *model.AppError)
func (a *App) GeneratePublicLink(siteURL string, info *model.FileInfo) string

func (*App) GetAllLdapGroupsPage

func (a *App) GetAllLdapGroupsPage(page int, perPage int, opts model.LdapGroupSearchOpts) ([]*model.Group, int, *model.AppError)

GetAllLdapGroupsPage retrieves all LDAP groups under the configured base DN using the default or configured group filter.

func (*App) GetAllRoles

func (a *App) GetAllRoles() ([]*model.Role, *model.AppError)

func (*App) GetAllStatuses

func (a *App) GetAllStatuses() map[string]*model.Status

func (*App) GetAnalytics

func (a *App) GetAnalytics(name string, teamId string) (model.AnalyticsRows, *model.AppError)

func (*App) GetAudits

func (a *App) GetAudits(userId string, limit int) (model.Audits, *model.AppError)

func (*App) GetAuditsPage

func (a *App) GetAuditsPage(userId string, page int, perPage int) (model.Audits, *model.AppError)

func (*App) GetAuthorizationCode

func (a *App) GetAuthorizationCode(w http.ResponseWriter, r *http.Request, service string, props map[string]string, loginHint string) (string, *model.AppError)

func (*App) GetAuthorizedAppsForUser

func (a *App) GetAuthorizedAppsForUser(userId string, page, perPage int) ([]*model.OAuthApp, *model.AppError)

func (*App) GetBrandImage

func (a *App) GetBrandImage() ([]byte, *model.AppError)

func (*App) GetBulkReactionsForPosts

func (a *App) GetBulkReactionsForPosts(postIds []string) (map[string][]*model.Reaction, *model.AppError)

func (*App) GetChannelGroupUsers

func (a *App) GetChannelGroupUsers(channelID string) ([]*model.User, *model.AppError)

GetChannelGroupUsers returns the users who are associated to the channel via GroupChannels and GroupMembers.

func (*App) GetChannelsForScheme

func (a *App) GetChannelsForScheme(scheme *model.Scheme, offset int, limit int) (model.ChannelList, *model.AppError)

func (*App) GetChannelsForSchemePage

func (a *App) GetChannelsForSchemePage(scheme *model.Scheme, page int, perPage int) (model.ChannelList, *model.AppError)

func (*App) GetClusterId

func (a *App) GetClusterId() string

func (*App) GetClusterStatus

func (a *App) GetClusterStatus() []*model.ClusterInfo

func (*App) GetCommand

func (a *App) GetCommand(commandId string) (*model.Command, *model.AppError)

func (*App) GetComplianceFile

func (a *App) GetComplianceFile(job *model.Compliance) ([]byte, *model.AppError)

func (*App) GetComplianceReport

func (a *App) GetComplianceReport(reportId string) (*model.Compliance, *model.AppError)

func (*App) GetComplianceReports

func (a *App) GetComplianceReports(page, perPage int) (model.Compliances, *model.AppError)

func (*App) GetConfigFile

func (a *App) GetConfigFile(name string) ([]byte, error)

GetConfigFile proxies access to the given configuration file to the underlying config store.

func (*App) GetCookieDomain

func (a *App) GetCookieDomain() string

func (*App) GetDataRetentionPolicy

func (a *App) GetDataRetentionPolicy() (*model.DataRetentionPolicy, *model.AppError)

func (*App) GetDefaultProfileImage

func (a *App) GetDefaultProfileImage(user *model.User) ([]byte, *model.AppError)

func (*App) GetEmoji

func (a *App) GetEmoji(emojiId string) (*model.Emoji, *model.AppError)

func (*App) GetEmojiByName

func (a *App) GetEmojiByName(emojiName string) (*model.Emoji, *model.AppError)

func (*App) GetEmojiImage

func (a *App) GetEmojiImage(emojiId string) ([]byte, string, *model.AppError)

func (*App) GetEmojiList

func (a *App) GetEmojiList(page, perPage int, sort string) ([]*model.Emoji, *model.AppError)

func (*App) GetEmojiStaticUrl

func (a *App) GetEmojiStaticUrl(emojiName string) (string, *model.AppError)

GetEmojiStaticUrl returns a relative static URL for system default emojis, and the API route for custom ones. Errors if not found or if custom and deleted.

func (*App) GetEnvironmentConfig

func (a *App) GetEnvironmentConfig() map[string]interface{}

GetEnvironmentConfig returns a map of configuration keys whose values have been overridden by an environment variable.

func (*App) GetFile

func (a *App) GetFile(fileId string) ([]byte, *model.AppError)

func (*App) GetFileInfo

func (a *App) GetFileInfo(fileId string) (*model.FileInfo, *model.AppError)

func (*App) GetFileInfos

func (a *App) GetFileInfos(page, perPage int, opt *model.GetFileInfosOptions) ([]*model.FileInfo, *model.AppError)

func (*App) GetHubForUserId

func (a *App) GetHubForUserId(userId string) *Hub

func (*App) GetIncomingWebhook

func (a *App) GetIncomingWebhook(hookId string) (*model.IncomingWebhook, *model.AppError)

func (*App) GetIncomingWebhooksForTeamPage

func (a *App) GetIncomingWebhooksForTeamPage(teamId string, page, perPage int) ([]*model.IncomingWebhook, *model.AppError)

func (*App) GetIncomingWebhooksForTeamPageByUser

func (a *App) GetIncomingWebhooksForTeamPageByUser(teamId string, userId string, page, perPage int) ([]*model.IncomingWebhook, *model.AppError)

func (*App) GetIncomingWebhooksPage

func (a *App) GetIncomingWebhooksPage(page, perPage int) ([]*model.IncomingWebhook, *model.AppError)

func (*App) GetIncomingWebhooksPageByUser

func (a *App) GetIncomingWebhooksPageByUser(userId string, page, perPage int) ([]*model.IncomingWebhook, *model.AppError)

func (*App) GetJob

func (a *App) GetJob(id string) (*model.Job, *model.AppError)

func (*App) GetJobs

func (a *App) GetJobs(offset int, limit int) ([]*model.Job, *model.AppError)

func (*App) GetJobsByType

func (a *App) GetJobsByType(jobType string, offset int, limit int) ([]*model.Job, *model.AppError)

func (*App) GetJobsByTypePage

func (a *App) GetJobsByTypePage(jobType string, page int, perPage int) ([]*model.Job, *model.AppError)

func (*App) GetJobsPage

func (a *App) GetJobsPage(page int, perPage int) ([]*model.Job, *model.AppError)

func (*App) GetLatestTermsOfService

func (a *App) GetLatestTermsOfService() (*model.TermsOfService, *model.AppError)

func (*App) GetLdapGroup

func (a *App) GetLdapGroup(ldapGroupID string) (*model.Group, *model.AppError)

GetLdapGroup retrieves a single LDAP group by the given LDAP group id.

func (*App) GetLogs

func (a *App) GetLogs(page, perPage int) ([]string, *model.AppError)

func (*App) GetLogsSkipSend

func (a *App) GetLogsSkipSend(page, perPage int) ([]string, *model.AppError)

func (*App) GetMessageForNotification

func (a *App) GetMessageForNotification(post *model.Post, translateFunc i18n.TranslateFunc) string

func (*App) GetMultipleEmojiByName

func (a *App) GetMultipleEmojiByName(names []string) ([]*model.Emoji, *model.AppError)

func (*App) GetNewUsersForTeamPage

func (a *App) GetNewUsersForTeamPage(teamId string, page, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError)

func (*App) GetNotificationNameFormat

func (a *App) GetNotificationNameFormat(user *model.User) string

func (*App) GetOAuthAccessTokenForCodeFlow

func (a *App) GetOAuthAccessTokenForCodeFlow(clientId, grantType, redirectUri, code, secret, refreshToken string) (*model.AccessResponse, *model.AppError)

func (*App) GetOAuthAccessTokenForImplicitFlow

func (a *App) GetOAuthAccessTokenForImplicitFlow(userId string, authRequest *model.AuthorizeRequest) (*model.Session, *model.AppError)

func (*App) GetOAuthApp

func (a *App) GetOAuthApp(appId string) (*model.OAuthApp, *model.AppError)

func (*App) GetOAuthApps

func (a *App) GetOAuthApps(page, perPage int) ([]*model.OAuthApp, *model.AppError)

func (*App) GetOAuthAppsByCreator

func (a *App) GetOAuthAppsByCreator(userId string, page, perPage int) ([]*model.OAuthApp, *model.AppError)

func (*App) GetOAuthCodeRedirect

func (a *App) GetOAuthCodeRedirect(userId string, authRequest *model.AuthorizeRequest) (string, *model.AppError)

func (*App) GetOAuthImplicitRedirect

func (a *App) GetOAuthImplicitRedirect(userId string, authRequest *model.AuthorizeRequest) (string, *model.AppError)

func (*App) GetOAuthLoginEndpoint

func (a *App) GetOAuthLoginEndpoint(w http.ResponseWriter, r *http.Request, service, teamId, action, redirectTo, loginHint string) (string, *model.AppError)

func (*App) GetOAuthSignupEndpoint

func (a *App) GetOAuthSignupEndpoint(w http.ResponseWriter, r *http.Request, service, teamId string) (string, *model.AppError)

func (*App) GetOAuthStateToken

func (a *App) GetOAuthStateToken(token string) (*model.Token, *model.AppError)

func (*App) GetOpenGraphMetadata

func (a *App) GetOpenGraphMetadata(requestURL string) *opengraph.OpenGraph

func (*App) GetOutgoingWebhook

func (a *App) GetOutgoingWebhook(hookId string) (*model.OutgoingWebhook, *model.AppError)

func (*App) GetOutgoingWebhooksForChannelPageByUser

func (a *App) GetOutgoingWebhooksForChannelPageByUser(channelId string, userId string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError)

func (*App) GetOutgoingWebhooksForTeamPage

func (a *App) GetOutgoingWebhooksForTeamPage(teamId string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError)

func (*App) GetOutgoingWebhooksForTeamPageByUser

func (a *App) GetOutgoingWebhooksForTeamPageByUser(teamId string, userId string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError)

func (*App) GetOutgoingWebhooksPage

func (a *App) GetOutgoingWebhooksPage(page, perPage int) ([]*model.OutgoingWebhook, *model.AppError)

func (*App) GetOutgoingWebhooksPageByUser

func (a *App) GetOutgoingWebhooksPageByUser(userId string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError)

func (*App) GetPasswordRecoveryToken

func (a *App) GetPasswordRecoveryToken(token string) (*model.Token, *model.AppError)

func (*App) GetPreferenceByCategoryAndNameForUser

func (a *App) GetPreferenceByCategoryAndNameForUser(userId string, category string, preferenceName string) (*model.Preference, *model.AppError)

func (*App) GetPreferenceByCategoryForUser

func (a *App) GetPreferenceByCategoryForUser(userId string, category string) (model.Preferences, *model.AppError)

func (*App) GetPreferencesForUser

func (a *App) GetPreferencesForUser(userId string) (model.Preferences, *model.AppError)

func (*App) GetProfileImage

func (a *App) GetProfileImage(user *model.User) ([]byte, bool, *model.AppError)

func (*App) GetReactionsForPost

func (a *App) GetReactionsForPost(postId string) ([]*model.Reaction, *model.AppError)

func (*App) GetRecentlyActiveUsersForTeam

func (a *App) GetRecentlyActiveUsersForTeam(teamId string) (map[string]*model.User, *model.AppError)

func (*App) GetRecentlyActiveUsersForTeamPage

func (a *App) GetRecentlyActiveUsersForTeamPage(teamId string, page, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError)

func (*App) GetRole

func (a *App) GetRole(id string) (*model.Role, *model.AppError)

func (*App) GetRoleByName

func (a *App) GetRoleByName(name string) (*model.Role, *model.AppError)

func (*App) GetRolesByNames

func (a *App) GetRolesByNames(names []string) ([]*model.Role, *model.AppError)

func (*App) GetSamlCertificateStatus

func (a *App) GetSamlCertificateStatus() *model.SamlCertificateStatus

func (*App) GetSamlMetadata

func (a *App) GetSamlMetadata() (string, *model.AppError)

func (*App) GetSamlMetadataFromIdp

func (a *App) GetSamlMetadataFromIdp(idpMetadataUrl string) (*model.SamlMetadataResponse, *model.AppError)

func (*App) GetSanitizeOptions

func (a *App) GetSanitizeOptions(asAdmin bool) map[string]bool

func (*App) GetSanitizedClientLicense

func (a *App) GetSanitizedClientLicense() map[string]string

func (*App) GetSanitizedConfig

func (a *App) GetSanitizedConfig() *model.Config

GetSanitizedConfig gets the configuration for a system admin without any secrets.

func (*App) GetScheme

func (a *App) GetScheme(id string) (*model.Scheme, *model.AppError)

func (*App) GetSchemeByName

func (a *App) GetSchemeByName(name string) (*model.Scheme, *model.AppError)

func (*App) GetSchemes

func (a *App) GetSchemes(scope string, offset int, limit int) ([]*model.Scheme, *model.AppError)

func (*App) GetSchemesPage

func (a *App) GetSchemesPage(scope string, page int, perPage int) ([]*model.Scheme, *model.AppError)

func (*App) GetSession

func (a *App) GetSession(token string) (*model.Session, *model.AppError)

func (*App) GetSessionById

func (a *App) GetSessionById(sessionId string) (*model.Session, *model.AppError)

func (*App) GetSessions

func (a *App) GetSessions(userId string) ([]*model.Session, *model.AppError)

func (*App) GetSiteURL

func (a *App) GetSiteURL() string

func (*App) GetStatus

func (a *App) GetStatus(userId string) (*model.Status, *model.AppError)

func (*App) GetStatusFromCache

func (a *App) GetStatusFromCache(userId string) *model.Status

func (*App) GetStatusesByIds

func (a *App) GetStatusesByIds(userIds []string) (map[string]interface{}, *model.AppError)

func (*App) GetT

func (a *App) GetT() goi18n.TranslateFunc

func (*App) GetTeamGroupUsers

func (a *App) GetTeamGroupUsers(teamID string) ([]*model.User, *model.AppError)

GetTeamGroupUsers returns the users who are associated to the team via GroupTeams and GroupMembers.

func (*App) GetTeamsForScheme

func (a *App) GetTeamsForScheme(scheme *model.Scheme, offset int, limit int) ([]*model.Team, *model.AppError)

func (*App) GetTeamsForSchemePage

func (a *App) GetTeamsForSchemePage(scheme *model.Scheme, page int, perPage int) ([]*model.Team, *model.AppError)

func (*App) GetTermsOfService

func (a *App) GetTermsOfService(id string) (*model.TermsOfService, *model.AppError)

func (*App) GetTotalUsersStats

func (a *App) GetTotalUsersStats(viewRestrictions *model.ViewUsersRestrictions) (*model.UsersStats, *model.AppError)

GetTotalUsersStats is used for the DM list total

func (*App) GetUser

func (a *App) GetUser(userId string) (*model.User, *model.AppError)

func (*App) GetUserAccessToken

func (a *App) GetUserAccessToken(tokenId string, sanitize bool) (*model.UserAccessToken, *model.AppError)

func (*App) GetUserAccessTokens

func (a *App) GetUserAccessTokens(page, perPage int) ([]*model.UserAccessToken, *model.AppError)

func (*App) GetUserAccessTokensForUser

func (a *App) GetUserAccessTokensForUser(userId string, page, perPage int) ([]*model.UserAccessToken, *model.AppError)

func (*App) GetUserByAuth

func (a *App) GetUserByAuth(authData *string, authService string) (*model.User, *model.AppError)

func (*App) GetUserByEmail

func (a *App) GetUserByEmail(email string) (*model.User, *model.AppError)

func (*App) GetUserByUsername

func (a *App) GetUserByUsername(username string) (*model.User, *model.AppError)

func (*App) GetUserForLogin

func (a *App) GetUserForLogin(id, loginId string) (*model.User, *model.AppError)

func (*App) GetUserStatusesByIds

func (a *App) GetUserStatusesByIds(userIds []string) ([]*model.Status, *model.AppError)

GetUserStatusesByIds used by apiV4

func (*App) GetUserTermsOfService

func (a *App) GetUserTermsOfService(userId string) (*model.UserTermsOfService, *model.AppError)

func (*App) GetUsers

func (a *App) GetUsers(options *model.UserGetOptions) ([]*model.User, *model.AppError)

func (*App) GetUsersByGroupChannelIds

func (a *App) GetUsersByGroupChannelIds(channelIds []string, asAdmin bool) (map[string][]*model.User, *model.AppError)

func (*App) GetUsersByIds

func (a *App) GetUsersByIds(userIds []string, options *store.UserGetByIdsOpts) ([]*model.User, *model.AppError)

func (*App) GetUsersByUsernames

func (a *App) GetUsersByUsernames(usernames []string, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError)

func (*App) GetUsersEtag

func (a *App) GetUsersEtag(restrictionsHash string) string

func (*App) GetUsersInChannel

func (a *App) GetUsersInChannel(channelId string, offset int, limit int) ([]*model.User, *model.AppError)

func (*App) GetUsersInChannelByStatus

func (a *App) GetUsersInChannelByStatus(channelId string, offset int, limit int) ([]*model.User, *model.AppError)

func (*App) GetUsersInChannelMap

func (a *App) GetUsersInChannelMap(channelId string, offset int, limit int, asAdmin bool) (map[string]*model.User, *model.AppError)

func (*App) GetUsersInChannelPage

func (a *App) GetUsersInChannelPage(channelId string, page int, perPage int, asAdmin bool) ([]*model.User, *model.AppError)

func (*App) GetUsersInChannelPageByStatus

func (a *App) GetUsersInChannelPageByStatus(channelId string, page int, perPage int, asAdmin bool) ([]*model.User, *model.AppError)

func (*App) GetUsersInTeam

func (a *App) GetUsersInTeam(options *model.UserGetOptions) ([]*model.User, *model.AppError)

func (*App) GetUsersInTeamEtag

func (a *App) GetUsersInTeamEtag(teamId string, restrictionsHash string) string

func (*App) GetUsersInTeamPage

func (a *App) GetUsersInTeamPage(options *model.UserGetOptions, asAdmin bool) ([]*model.User, *model.AppError)

func (*App) GetUsersNotInChannel

func (a *App) GetUsersNotInChannel(teamId string, channelId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError)

func (*App) GetUsersNotInChannelMap

func (a *App) GetUsersNotInChannelMap(teamId string, channelId string, groupConstrained bool, offset int, limit int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) (map[string]*model.User, *model.AppError)

func (*App) GetUsersNotInChannelPage

func (a *App) GetUsersNotInChannelPage(teamId string, channelId string, groupConstrained bool, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError)

func (*App) GetUsersNotInTeam

func (a *App) GetUsersNotInTeam(teamId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError)

func (*App) GetUsersNotInTeamEtag

func (a *App) GetUsersNotInTeamEtag(teamId string, restrictionsHash string) string

func (*App) GetUsersNotInTeamPage

func (a *App) GetUsersNotInTeamPage(teamId string, groupConstrained bool, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError)

func (*App) GetUsersPage

func (a *App) GetUsersPage(options *model.UserGetOptions, asAdmin bool) ([]*model.User, *model.AppError)

func (*App) GetUsersWithoutTeam

func (a *App) GetUsersWithoutTeam(options *model.UserGetOptions) ([]*model.User, *model.AppError)

func (*App) GetUsersWithoutTeamPage

func (a *App) GetUsersWithoutTeamPage(options *model.UserGetOptions, asAdmin bool) ([]*model.User, *model.AppError)

func (*App) GetVerifyEmailToken

func (a *App) GetVerifyEmailToken(token string) (*model.Token, *model.AppError)

func (*App) GetViewUsersRestrictions

func (a *App) GetViewUsersRestrictions(userId string) (*model.ViewUsersRestrictions, *model.AppError)

func (*App) HTMLTemplates

func (a *App) HTMLTemplates() *template.Template

func (*App) HTTPService

func (a *App) HTTPService() httpservice.HTTPService

func (*App) Handle404

func (a *App) Handle404(w http.ResponseWriter, r *http.Request)

func (*App) HandleCommandResponse

func (a *App) HandleCommandResponse(command *model.Command, args *model.CommandArgs, response *model.CommandResponse, builtIn bool) (*model.CommandResponse, *model.AppError)

func (*App) HandleCommandResponsePost

func (a *App) HandleCommandResponsePost(command *model.Command, args *model.CommandArgs, response *model.CommandResponse, builtIn bool) (*model.Post, *model.AppError)

func (*App) HandleCommandWebhook

func (a *App) HandleCommandWebhook(hookId string, response *model.CommandResponse) *model.AppError

func (*App) HandleImages

func (a *App) HandleImages(previewPathList []string, thumbnailPathList []string, fileData [][]byte)

func (*App) HandleIncomingWebhook

func (a *App) HandleIncomingWebhook(hookId string, req *model.IncomingWebhookRequest) *model.AppError

func (*App) HandleMessageExportConfig

func (a *App) HandleMessageExportConfig(cfg *model.Config, appCfg *model.Config)

func (*App) HasPermissionTo

func (a *App) HasPermissionTo(askingUserId string, permission *model.Permission) bool

func (*App) HasPermissionToChannel

func (a *App) HasPermissionToChannel(askingUserId string, channelId string, permission *model.Permission) bool

func (*App) HasPermissionToChannelByPost

func (a *App) HasPermissionToChannelByPost(askingUserId string, postId string, permission *model.Permission) bool

func (*App) HasPermissionToTeam

func (a *App) HasPermissionToTeam(askingUserId string, teamId string, permission *model.Permission) bool

func (*App) HasPermissionToUser

func (a *App) HasPermissionToUser(askingUserId string, userId string) bool

func (*App) HubRegister

func (a *App) HubRegister(webConn *WebConn)

func (*App) HubStart

func (a *App) HubStart()

func (*App) HubStop

func (a *App) HubStop()

func (*App) HubUnregister

func (a *App) HubUnregister(webConn *WebConn)

func (*App) ImageProxy

func (a *App) ImageProxy() *imageproxy.ImageProxy

func (*App) ImportPermissions

func (a *App) ImportPermissions(jsonl io.Reader) error

func (*App) InvalidateAllCaches

func (a *App) InvalidateAllCaches() *model.AppError

func (*App) InvalidateAllCachesSkipSend

func (a *App) InvalidateAllCachesSkipSend()

func (*App) InvalidateCacheForUser

func (a *App) InvalidateCacheForUser(userId string)

func (*App) InvalidateWebConnSessionCacheForUser

func (a *App) InvalidateWebConnSessionCacheForUser(userId string)

func (*App) IpAddress

func (a *App) IpAddress() string

func (*App) IsFirstUserAccount

func (a *App) IsFirstUserAccount() bool

func (*App) IsLeader

func (a *App) IsLeader() bool

func (*App) IsPasswordValid

func (a *App) IsPasswordValid(password string) *model.AppError

func (*App) IsPhase2MigrationCompleted

func (a *App) IsPhase2MigrationCompleted() *model.AppError

func (*App) IsUserAway

func (a *App) IsUserAway(lastActivityAt int64) bool

func (*App) IsUserSignUpAllowed

func (a *App) IsUserSignUpAllowed() *model.AppError

func (*App) IsUsernameTaken

func (a *App) IsUsernameTaken(name string) bool

IsUsernameTaken checks if the username is already used by another user. Return false if the username is invalid.

func (*App) Ldap

func (a *App) Ldap() einterfaces.LdapInterface

func (*App) License

func (a *App) License() *model.License

License returns the currently active license or nil if the application is unlicensed.

func (*App) LimitedClientConfig

func (a *App) LimitedClientConfig() map[string]string

func (*App) LimitedClientConfigWithComputed

func (a *App) LimitedClientConfigWithComputed() map[string]string

LimitedClientConfigWithComputed gets the configuration in a format suitable for sending to the client.

func (*App) ListAllCommands

func (a *App) ListAllCommands(teamId string, T goi18n.TranslateFunc) ([]*model.Command, *model.AppError)

func (*App) ListAutocompleteCommands

func (a *App) ListAutocompleteCommands(teamId string, T goi18n.TranslateFunc) ([]*model.Command, *model.AppError)

@openTracingParams teamId previous ListCommands now ListAutocompleteCommands

func (*App) ListDirectory

func (a *App) ListDirectory(path string) ([]string, *model.AppError)

func (*App) ListTeamCommands

func (a *App) ListTeamCommands(teamId string) ([]*model.Command, *model.AppError)

func (*App) LoadLicense

func (a *App) LoadLicense()

func (*App) Log

func (a *App) Log() *mlog.Logger

func (*App) LoginByOAuth

func (a *App) LoginByOAuth(service string, userData io.Reader, teamId string) (*model.User, *model.AppError)

func (*App) MakePermissionError

func (a *App) MakePermissionError(permission *model.Permission) *model.AppError

func (*App) MessageExport

func (a *App) MessageExport() einterfaces.MessageExportInterface

func (*App) Metrics

func (a *App) Metrics() einterfaces.MetricsInterface

func (*App) MigrateFilenamesToFileInfos

func (a *App) MigrateFilenamesToFileInfos(post *model.Post) []*model.FileInfo

Creates and stores FileInfos for a post created before the FileInfos table existed.

func (*App) MoveCommand

func (a *App) MoveCommand(team *model.Team, command *model.Command) *model.AppError

func (*App) MoveFile

func (a *App) MoveFile(oldPath, newPath string) *model.AppError

func (*App) NewClusterDiscoveryService

func (a *App) NewClusterDiscoveryService() *ClusterDiscoveryService

func (*App) NewWebConn

func (a *App) NewWebConn(ws *websocket.Conn, session model.Session, t goi18n.TranslateFunc, locale string) *WebConn

func (*App) NewWebHub

func (a *App) NewWebHub() *Hub

func (*App) Notification

func (a *App) Notification() einterfaces.NotificationInterface

func (*App) NotificationsLog

func (a *App) NotificationsLog() *mlog.Logger

func (*App) OpenInteractiveDialog

func (a *App) OpenInteractiveDialog(request model.OpenDialogRequest) *model.AppError

func (*App) OriginChecker

func (a *App) OriginChecker() func(*http.Request) bool

func (*App) PatchRole

func (a *App) PatchRole(role *model.Role, patch *model.RolePatch) (*model.Role, *model.AppError)

func (*App) PatchScheme

func (a *App) PatchScheme(scheme *model.Scheme, patch *model.SchemePatch) (*model.Scheme, *model.AppError)

func (*App) PatchUser