app

package
v4.6.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2018 License: AGPL-3.0, Apache-2.0 Imports: 72 Imported by: 452

Documentation

Index

Constants

View Source
const (
	DAY_MILLISECONDS   = 24 * 60 * 60 * 1000
	MONTH_MILLISECONDS = 31 * DAY_MILLISECONDS
)
View Source
const (
	USER_PASSWORD              = "passwd"
	CHANNEL_TYPE               = model.CHANNEL_OPEN
	FUZZ_USER_EMAIL_PREFIX_LEN = 10
	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 (
	CMD_EXPAND   = "expand"
	CMD_COLLAPSE = "collapse"
)
View Source
const (
	CMD_REMOVE = "remove"
	CMD_KICK   = "kick"
)
View Source
const (
	SEGMENT_KEY = "fwb7VPbFeQ7SKp3wHm1RzFUuXZudqVok"

	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_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_WEBRTC         = "config_webrtc"
	TRACK_CONFIG_SUPPORT        = "config_support"
	TRACK_CONFIG_NATIVEAPP      = "config_nativeapp"
	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_ACTIVITY = "activity"
	TRACK_LICENSE  = "license"
	TRACK_SERVER   = "server"
	TRACK_PLUGINS  = "plugins"
)
View Source
const (
	MaxEmojiFileSize = 1000 * 1024 // 1 MB
	MaxEmojiWidth    = 128
	MaxEmojiHeight   = 128
)
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
	IMAGE_THUMBNAIL_PIXEL_WIDTH  = 120
	IMAGE_THUMBNAIL_PIXEL_HEIGHT = 100
	IMAGE_PREVIEW_PIXEL_WIDTH    = 1024
)
View Source
const (
	OAUTH_COOKIE_MAX_AGE_SECONDS = 30 * 60 // 30 minutes
	COOKIE_OAUTH                 = "MMOAUTH"
)
View Source
const (
	SECURITY_URL           = "https://d7zmvsa9e04kk.cloudfront.net"
	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"
	PASSWORD_RECOVER_EXPIRY_TIME  = 1000 * 60 * 60 // 1 hour
	VERIFY_EMAIL_EXPIRY_TIME      = 1000 * 60 * 60 // 1 hour
	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
)
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_HEADER = "header"
)
View Source
const (
	CMD_HELP = "help"
)
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_OFFLINE = "offline"
)
View Source
const (
	CMD_ONLINE = "online"
)
View Source
const (
	CMD_OPEN = "open"
)
View Source
const (
	CMD_PURPOSE = "purpose"
)
View Source
const (
	CMD_RENAME = "rename"
)
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 (
	PLUGIN_MAX_ID_LENGTH = 190
)
View Source
const TIME_TO_WAIT_FOR_CONNECTIONS_TO_CLOSE_ON_SERVER_SHUTDOWN = time.Second

Variables

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}
	POST_MESSAGE_LEN         = utils.Range{Begin: 100, End: 400}
	POST_HASHTAGS_NUM        = utils.Range{Begin: 5, End: 10}
	POST_MENTIONS_NUM        = utils.Range{Begin: 0, End: 3}
	TEST_IMAGE_FILENAMES     = []string{"test.png", "testjpg.jpg", "testgif.gif"}
)

Functions

func CheckUserDomain

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

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

func ClearStatusCache

func ClearStatusCache()

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 GenerateTurnPassword

func GenerateTurnPassword(username string, secret string) string

func GetExplicitMentions

func GetExplicitMentions(message string, keywords map[string][]string) (map[string]bool, []string, bool, bool, bool)

Given a message and a map mapping mention keywords to the users who use them, returns a map of mentioned users and a slice of potential mention users not in the channel and whether or not @here was mentioned.

func GetProtocol

func GetProtocol(r *http.Request) string

func GetStatusFromCache

func GetStatusFromCache(userId string) *model.Status

func RegisterAccountMigrationInterface

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

func RegisterBrandInterface

func RegisterBrandInterface(f func(*App) einterfaces.BrandInterface)

func RegisterClusterInterface

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

func RegisterCommandProvider

func RegisterCommandProvider(newProvider CommandProvider)

func RegisterComplianceInterface

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

func RegisterDataRetentionInterface

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

func RegisterElasticsearchInterface

func RegisterElasticsearchInterface(f func(*App) einterfaces.ElasticsearchInterface)

func RegisterEmojiInterface

func RegisterEmojiInterface(f func(*App) einterfaces.EmojiInterface)

func RegisterJobsDataRetentionJobInterface

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

func RegisterJobsElasticsearchAggregatorInterface

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

func RegisterJobsElasticsearchIndexerInterface

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

func RegisterJobsLdapSyncInterface

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

func RegisterJobsMessageExportJobInterface

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

func RegisterLdapInterface

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

func RegisterMessageExportInterface

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

func RegisterMetricsInterface

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

func RegisterMfaInterface

func RegisterMfaInterface(f func(*App) einterfaces.MfaInterface)

func RegisterSamlInterface

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

func RemoveSamlFile

func RemoveSamlFile(filename string) *model.AppError

func ReturnWebSocketError

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

func SendDiagnostic

func SendDiagnostic(event string, properties map[string]interface{})

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) ([]*model.Post, *model.AppError)

func StopTestStore

func StopTestStore()

func UseTestStore

func UseTestStore(container *storetest.RunningContainer, settings *model.SqlSettings)

UseTestStore sets the container and corresponding settings to use for tests. Once the tests are complete (e.g. at the end of your TestMain implementation), you should call StopTestStore.

func WriteSamlFile

func WriteSamlFile(fileData *multipart.FileHeader) *model.AppError

Types

type App

type App struct {
	Srv *Server

	PluginEnv              *pluginenv.Environment
	PluginConfigListenerId string

	EmailBatching *EmailBatchingJob

	Hubs                        []*Hub
	HubsStopCheckingForDeadlock chan bool

	Jobs *jobs.JobServer

	AccountMigration einterfaces.AccountMigrationInterface
	Brand            einterfaces.BrandInterface
	Cluster          einterfaces.ClusterInterface
	Compliance       einterfaces.ComplianceInterface
	DataRetention    einterfaces.DataRetentionInterface
	Elasticsearch    einterfaces.ElasticsearchInterface
	Emoji            einterfaces.EmojiInterface
	Ldap             einterfaces.LdapInterface
	MessageExport    einterfaces.MessageExportInterface
	Metrics          einterfaces.MetricsInterface
	Mfa              einterfaces.MfaInterface
	Saml             einterfaces.SamlInterface
	// contains filtered or unexported fields
}

func New

func New(options ...Option) *App

New creates a new App. You must call Shutdown when you're done with it. XXX: For now, only one at a time is allowed as some resources are still shared.

func (*App) ActivateMfa

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

func (*App) ActivatePlugins

func (a *App) ActivatePlugins()

ActivatePlugins will activate any plugins enabled in the config and deactivate all other plugins.

func (*App) AddChannelMember

func (a *App) AddChannelMember(userId string, channel *model.Channel, userRequestorId string, postRootId string) (*model.ChannelMember, *model.AppError)

func (*App) AddDirectChannels

func (a *App) AddDirectChannels(teamId string, user *model.User) *model.AppError

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) AddTeamMember

func (a *App) AddTeamMember(teamId, userId string) (*model.TeamMember, *model.AppError)

func (*App) AddTeamMemberByHash

func (a *App) AddTeamMemberByHash(userId, hash, data string) (*model.TeamMember, *model.AppError)

func (*App) AddTeamMemberByInviteId

func (a *App) AddTeamMemberByInviteId(inviteId, userId string) (*model.TeamMember, *model.AppError)

func (*App) AddTeamMembers

func (a *App) AddTeamMembers(teamId string, userIds []string, userRequestorId string) ([]*model.TeamMember, *model.AppError)

func (*App) AddUserToChannel

func (a *App) AddUserToChannel(user *model.User, channel *model.Channel) (*model.ChannelMember, *model.AppError)

func (*App) AddUserToTeam

func (a *App) AddUserToTeam(teamId string, userId string, userRequestorId string) (*model.Team, *model.AppError)

func (*App) AddUserToTeamByHash

func (a *App) AddUserToTeamByHash(userId string, hash string, data string) (*model.Team, *model.AppError)

func (*App) AddUserToTeamByInviteId

func (a *App) AddUserToTeamByInviteId(inviteId string, userId string) (*model.Team, *model.AppError)

func (*App) AddUserToTeamByTeamId

func (a *App) AddUserToTeamByTeamId(teamId string, user *model.User) *model.AppError

func (*App) AllowOAuthAppAccessToUser

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

func (*App) AttachDeviceId

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

func (*App) AuthenticateUserForLogin

func (a *App) AuthenticateUserForLogin(id, loginId, password, mfaToken, deviceId string, ldapOnly bool) (*model.User, *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, searchOptions map[string]bool, asAdmin bool) (*model.UserAutocompleteInChannel, *model.AppError)

func (*App) AutocompleteUsersInTeam

func (a *App) AutocompleteUsersInTeam(teamId string, term string, searchOptions map[string]bool, asAdmin bool) (*model.UserAutocompleteInTeam, *model.AppError)

func (*App) BroadcastStatus

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

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) CheckIfRolesGrantPermission

func (a *App) CheckIfRolesGrantPermission(roles []string, permissionId string) bool

func (*App) CheckPasswordAndAllCriteria

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

func (*App) CheckUserAdditionalAuthenticationCriteria

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

func (*App) CheckUserMfa

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

func (*App) ClearPushNotification

func (a *App) ClearPushNotification(userId string, channelId string)

func (*App) ClearSessionCacheForUser

func (a *App) ClearSessionCacheForUser(userId string)

func (*App) ClearSessionCacheForUserSkipClusterSend

func (a *App) ClearSessionCacheForUserSkipClusterSend(userId string)

func (*App) ClusterClearSessionCacheForUserHandler

func (a *App) ClusterClearSessionCacheForUserHandler(msg *model.ClusterMessage)

func (*App) ClusterInvalidateAllCachesHandler

func (a *App) ClusterInvalidateAllCachesHandler(msg *model.ClusterMessage)

func (*App) ClusterInvalidateCacheForChannelByNameHandler

func (a *App) ClusterInvalidateCacheForChannelByNameHandler(msg *model.ClusterMessage)

func (*App) ClusterInvalidateCacheForChannelHandler

func (a *App) ClusterInvalidateCacheForChannelHandler(msg *model.ClusterMessage)

func (*App) ClusterInvalidateCacheForChannelMembersHandler

func (a *App) ClusterInvalidateCacheForChannelMembersHandler(msg *model.ClusterMessage)

func (*App) ClusterInvalidateCacheForChannelMembersNotifyPropHandler

func (a *App) ClusterInvalidateCacheForChannelMembersNotifyPropHandler(msg *model.ClusterMessage)

func (*App) ClusterInvalidateCacheForChannelPostsHandler

func (a *App) ClusterInvalidateCacheForChannelPostsHandler(msg *model.ClusterMessage)

func (*App) ClusterInvalidateCacheForUserHandler

func (a *App) ClusterInvalidateCacheForUserHandler(msg *model.ClusterMessage)

func (*App) ClusterInvalidateCacheForWebhookHandler

func (a *App) ClusterInvalidateCacheForWebhookHandler(msg *model.ClusterMessage)

func (*App) ClusterPublishHandler

func (a *App) ClusterPublishHandler(msg *model.ClusterMessage)

func (*App) ClusterUpdateStatusHandler

func (a *App) ClusterUpdateStatusHandler(msg *model.ClusterMessage)

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.ReadCloser, email string) (*model.User, *model.AppError)

func (*App) Config

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

func (*App) ConfigFileName

func (a *App) ConfigFileName() string

func (*App) CreateBasicUser

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

Basic test team and user so you always know one

func (*App) CreateChannel

func (a *App) CreateChannel(channel *model.Channel, addMember bool) (*model.Channel, *model.AppError)

func (*App) CreateChannelWithUser

func (a *App) CreateChannelWithUser(channel *model.Channel, userId string) (*model.Channel, *model.AppError)

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) (*model.Post, *model.AppError)

func (*App) CreateCommandWebhook

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

func (*App) CreateDefaultChannels

func (a *App) CreateDefaultChannels(teamId string) ([]*model.Channel, *model.AppError)

func (*App) CreateDirectChannel

func (a *App) CreateDirectChannel(userId string, otherUserId string) (*model.Channel, *model.AppError)

func (*App) CreateEmoji

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

func (*App) CreateGroupChannel

func (a *App) CreateGroupChannel(userIds []string, creatorId string) (*model.Channel, *model.AppError)

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 string) (*model.Token, *model.AppError)

func (*App) CreatePost

func (a *App) CreatePost(post *model.Post, channel *model.Channel, triggerWebhooks bool) (*model.Post, *model.AppError)

func (*App) CreatePostAsUser

func (a *App) CreatePostAsUser(post *model.Post) (*model.Post, *model.AppError)

func (*App) CreatePostMissingChannel

func (a *App) CreatePostMissingChannel(post *model.Post, triggerWebhooks bool) (*model.Post, *model.AppError)

func (*App) CreateSession

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

func (*App) CreateTeam

func (a *App) CreateTeam(team *model.Team) (*model.Team, *model.AppError)

func (*App) CreateTeamWithUser

func (a *App) CreateTeamWithUser(team *model.Team, userId string) (*model.Team, *model.AppError)

func (*App) CreateUser

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

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) CreateUserWithHash

func (a *App) CreateUserWithHash(user *model.User, hash string, data string) (*model.User, *model.AppError)

func (*App) CreateUserWithInviteId

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

func (*App) CreateVerifyEmailToken

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

func (*App) CreateWebhookPost

func (a *App) CreateWebhookPost(userId string, channel *model.Channel, text, overrideUsername, overrideIconUrl string, props model.StringInterface, postType string, postRootId string) (*model.Post, *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) DeleteChannel

func (a *App) DeleteChannel(channel *model.Channel, userId string) *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) DeleteFlaggedPosts

func (a *App) DeleteFlaggedPosts(postId string)

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) DeletePluginKey

func (a *App) DeletePluginKey(pluginId string, key string) *model.AppError

func (*App) DeletePost

func (a *App) DeletePost(postId string) (*model.Post, *model.AppError)

func (*App) DeletePostFiles

func (a *App) DeletePostFiles(post *model.Post)

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) DeleteToken

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

func (*App) DisablePlugin

func (a *App) DisablePlugin(id string) *model.AppError

DisablePlugin will set the config for an installed plugin to disabled, triggering deactivation if active.

func (*App) DisableUserAccessToken

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

func (*App) DoLogin

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

func (*App) DoPostAction

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

func (*App) DoSecurityUpdateCheck

func (a *App) DoSecurityUpdateCheck()

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) EnablePlugin

func (a *App) EnablePlugin(id string) *model.AppError

EnablePlugin will set the config for an installed plugin to enabled, triggering activation if inactive.

func (*App) EnableUserAccessToken

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

func (*App) ExecuteCommand

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

func (*App) ExecutePluginCommand

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

func (*App) FileBackend

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

func (*App) FillInPostProps

func (a *App) FillInPostProps(post *model.Post, channel *model.Channel) *model.AppError

FillInPostProps should be invoked before saving posts to fill in properties such as channel_mentions.

If channel is nil, FillInPostProps will look up the channel corresponding to the post.

func (*App) FindTeamByName

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

func (*App) FindTeamIdForFilename

func (a *App) FindTeamIdForFilename(post *model.Post, filename string) string

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) GeneratePublicLinkV3

func (a *App) GeneratePublicLinkV3(siteURL string, info *model.FileInfo) string

func (*App) GetActivePluginManifests

func (a *App) GetActivePluginManifests() ([]*model.Manifest, *model.AppError)

func (*App) GetAllOpenTeams

func (a *App) GetAllOpenTeams() ([]*model.Team, *model.AppError)

func (*App) GetAllOpenTeamsPage

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

func (*App) GetAllStatuses

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

func (*App) GetAllTeams

func (a *App) GetAllTeams() ([]*model.Team, *model.AppError)

func (*App) GetAllTeamsPage

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

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) GetChannel

func (a *App) GetChannel(channelId string) (*model.Channel, *model.AppError)

func (*App) GetChannelByName

func (a *App) GetChannelByName(channelName, teamId string) (*model.Channel, *model.AppError)

func (*App) GetChannelByNameForTeamName

func (a *App) GetChannelByNameForTeamName(channelName, teamName string) (*model.Channel, *model.AppError)

func (*App) GetChannelCounts

func (a *App) GetChannelCounts(teamId string, userId string) (*model.ChannelCounts, *model.AppError)

func (*App) GetChannelMember

func (a *App) GetChannelMember(channelId string, userId string) (*model.ChannelMember, *model.AppError)

func (*App) GetChannelMemberCount

func (a *App) GetChannelMemberCount(channelId string) (int64, *model.AppError)

func (*App) GetChannelMembersByIds

func (a *App) GetChannelMembersByIds(channelId string, userIds []string) (*model.ChannelMembers, *model.AppError)

func (*App) GetChannelMembersForUser

func (a *App) GetChannelMembersForUser(teamId string, userId string) (*model.ChannelMembers, *model.AppError)

func (*App) GetChannelMembersPage

func (a *App) GetChannelMembersPage(channelId string, page, perPage int) (*model.ChannelMembers, *model.AppError)

func (*App) GetChannelUnread

func (a *App) GetChannelUnread(channelId, userId string) (*model.ChannelUnread, *model.AppError)

func (*App) GetChannelsByNames

func (a *App) GetChannelsByNames(channelNames []string, teamId string) ([]*model.Channel, *model.AppError)

func (*App) GetChannelsForUser

func (a *App) GetChannelsForUser(teamId string, userId string) (*model.ChannelList, *model.AppError)

func (*App) GetChannelsUserNotIn

func (a *App) GetChannelsUserNotIn(teamId string, userId string, offset int, limit int) (*model.ChannelList, *model.AppError)

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) GetConfig

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

func (*App) GetDataRetentionPolicy

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

func (*App) GetDeletedChannels

func (a *App) GetDeletedChannels(teamId string, offset int, limit int) (*model.ChannelList, *model.AppError)

func (*App) GetDirectChannel

func (a *App) GetDirectChannel(userId1, userId2 string) (*model.Channel, *model.AppError)

func (*App) GetEmoji

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

func (*App) GetEmojiImage

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

func (*App) GetEmojiList

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

func (*App) GetFileInfo

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

func (*App) GetFileInfosForPost

func (a *App) GetFileInfosForPost(postId string, readFromMaster bool) ([]*model.FileInfo, *model.AppError)

func (*App) GetFlaggedPosts

func (a *App) GetFlaggedPosts(userId string, offset int, limit int) (*model.PostList, *model.AppError)

func (*App) GetFlaggedPostsForChannel

func (a *App) GetFlaggedPostsForChannel(userId, channelId string, offset int, limit int) (*model.PostList, *model.AppError)

func (*App) GetFlaggedPostsForTeam

func (a *App) GetFlaggedPostsForTeam(userId, teamId string, offset int, limit int) (*model.PostList, *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) GetIncomingWebhooksPage

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

func (*App) GetInfoForFilename

func (a *App) GetInfoForFilename(post *model.Post, teamId string, filename string) *model.FileInfo

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) 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) GetMentionKeywordsInChannel

func (a *App) GetMentionKeywordsInChannel(profiles map[string]*model.User, lookForSpecialMentions bool) map[string][]string

Given a map of user IDs to profiles, returns a list of mention keywords for all users in the channel.

func (*App) GetMessageForNotification

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

func (*App) GetNewUsersForTeamPage

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

func (*App) GetNumberOfChannelsOnTeam

func (a *App) GetNumberOfChannelsOnTeam(teamId string) (int, *model.AppError)

func (*App) GetOAuthAccessToken

func (a *App) GetOAuthAccessToken(clientId, grantType, redirectUri, code, secret, refreshToken string) (*model.AccessResponse, *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) 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(url string) *opengraph.OpenGraph

func (*App) GetOutgoingWebhook

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

func (*App) GetOutgoingWebhooksForChannelPage

func (a *App) GetOutgoingWebhooksForChannelPage(channelId 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) GetOutgoingWebhooksPage

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

func (*App) GetPasswordRecoveryToken

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

func (*App) GetPermalinkPost

func (a *App) GetPermalinkPost(postId string, userId string) (*model.PostList, *model.AppError)

func (*App) GetPinnedPosts

func (a *App) GetPinnedPosts(channelId string) (*model.PostList, *model.AppError)

func (*App) GetPluginKey

func (a *App) GetPluginKey(pluginId string, key string) ([]byte, *model.AppError)

func (*App) GetPlugins

func (a *App) GetPlugins() (*model.PluginsResponse, *model.AppError)

func (*App) GetPostThread

func (a *App) GetPostThread(postId string) (*model.PostList, *model.AppError)

func (*App) GetPosts

func (a *App) GetPosts(channelId string, offset int, limit int) (*model.PostList, *model.AppError)

func (*App) GetPostsAfterPost

func (a *App) GetPostsAfterPost(channelId, postId string, page, perPage int) (*model.PostList, *model.AppError)

func (*App) GetPostsAroundPost

func (a *App) GetPostsAroundPost(postId, channelId string, offset, limit int, before bool) (*model.PostList, *model.AppError)

func (*App) GetPostsBeforePost

func (a *App) GetPostsBeforePost(channelId, postId string, page, perPage int) (*model.PostList, *model.AppError)

func (*App) GetPostsEtag

func (a *App) GetPostsEtag(channelId string) string

func (*App) GetPostsPage

func (a *App) GetPostsPage(channelId string, page int, perPage int) (*model.PostList, *model.AppError)

func (*App) GetPostsSince

func (a *App) GetPostsSince(channelId string, time int64) (*model.PostList, *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) GetPublicChannelsByIdsForTeam

func (a *App) GetPublicChannelsByIdsForTeam(teamId string, channelIds []string) (*model.ChannelList, *model.AppError)

func (*App) GetPublicChannelsForTeam

func (a *App) GetPublicChannelsForTeam(teamId string, offset int, limit int) (*model.ChannelList, *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) ([]*model.User, *model.AppError)

func (*App) GetSamlCertificateStatus

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

func (*App) GetSamlMetadata

func (a *App) GetSamlMetadata() (string, *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) GetSinglePost

func (a *App) GetSinglePost(postId string) (*model.Post, *model.AppError)

func (*App) GetStatus

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

func (*App) GetStatusesByIds

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

func (*App) GetTeam

func (a *App) GetTeam(teamId string) (*model.Team, *model.AppError)

func (*App) GetTeamByInviteId

func (a *App) GetTeamByInviteId(inviteId string) (*model.Team, *model.AppError)

func (*App) GetTeamByName

func (a *App) GetTeamByName(name string) (*model.Team, *model.AppError)

func (*App) GetTeamIdFromQuery

func (a *App) GetTeamIdFromQuery(query url.Values) (string, *model.AppError)

func (*App) GetTeamMember

func (a *App) GetTeamMember(teamId, userId string) (*model.TeamMember, *model.AppError)

func (*App) GetTeamMembers

func (a *App) GetTeamMembers(teamId string, offset int, limit int) ([]*model.TeamMember, *model.AppError)

func (*App) GetTeamMembersByIds

func (a *App) GetTeamMembersByIds(teamId string, userIds []string) ([]*model.TeamMember, *model.AppError)

func (*App) GetTeamMembersForUser

func (a *App) GetTeamMembersForUser(userId string) ([]*model.TeamMember, *model.AppError)

func (*App) GetTeamStats

func (a *App) GetTeamStats(teamId string) (*model.TeamStats, *model.AppError)

func (*App) GetTeamUnread

func (a *App) GetTeamUnread(teamId, userId string) (*model.TeamUnread, *model.AppError)

func (*App) GetTeamsForUser

func (a *App) GetTeamsForUser(userId string) ([]*model.Team, *model.AppError)

func (*App) GetTeamsUnreadForUser

func (a *App) GetTeamsUnreadForUser(excludeTeamId string, userId string) ([]*model.TeamUnread, *model.AppError)

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) 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(loginId string, onlyLdap bool) (*model.User, *model.AppError)

func (*App) GetUserStatusesByIds

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

GetUserStatusesByIds used by apiV4

func (*App) GetUsers

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

func (*App) GetUsersByIds

func (a *App) GetUsersByIds(userIds []string, asAdmin bool) ([]*model.User, *model.AppError)

func (*App) GetUsersByUsernames

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

func (*App) GetUsersEtag

func (a *App) GetUsersEtag() string

func (*App) GetUsersInChannel

func (a *App) GetUsersInChannel(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) GetUsersInTeam

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

func (*App) GetUsersInTeamEtag

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

func (*App) GetUsersInTeamMap

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

func (*App) GetUsersInTeamPage

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

func (*App) GetUsersMap

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

func (*App) GetUsersNotInChannel

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

func (*App) GetUsersNotInChannelMap

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

func (*App) GetUsersNotInChannelPage

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

func (*App) GetUsersNotInTeam

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

func (*App) GetUsersNotInTeamEtag

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

func (*App) GetUsersNotInTeamPage

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

func (*App) GetUsersPage

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

func (*App) GetUsersWithoutTeam

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

func (*App) GetUsersWithoutTeamPage

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

func (*App) GetVerifyEmailToken

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

func (*App) GetWebrtcInfoForSession

func (a *App) GetWebrtcInfoForSession(sessionId string) (*model.WebrtcInfoResponse, *model.AppError)

func (*App) GetWebrtcToken

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

func (*App) Go

func (a *App) Go(f func())

Go creates a goroutine, but maintains a record of it to ensure that execution completes before the app is destroyed.

func (*App) HTMLTemplates

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

func (*App) HTTPClient

func (a *App) HTTPClient(trustURLs bool) *http.Client

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) 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) 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) ImportChannel

func (a *App) ImportChannel(data *ChannelImportData, dryRun bool) *model.AppError

func (*App) ImportDirectChannel

func (a *App) ImportDirectChannel(data *DirectChannelImportData, dryRun bool) *model.AppError

func (*App) ImportDirectPost

func (a *App) ImportDirectPost(data *DirectPostImportData, dryRun bool) *model.AppError

func (*App) ImportLine

func (a *App) ImportLine(line LineImportData, dryRun bool) *model.AppError

func (*App) ImportPost

func (a *App) ImportPost(data *PostImportData, dryRun bool) *model.AppError

func (*App) ImportTeam

func (a *App) ImportTeam(data *TeamImportData, dryRun bool) *model.AppError

func (*App) ImportUser

func (a *App) ImportUser(data *UserImportData, dryRun bool) *model.AppError

func (*App) ImportUserChannels

func (a *App) ImportUserChannels(user *model.User, team *model.Team, teamMember *model.TeamMember, data *[]UserChannelImportData) *model.AppError

func (*App) ImportUserTeams

func (a *App) ImportUserTeams(user *model.User, data *[]UserTeamImportData) *model.AppError

func (*App) InitEmailBatching

func (a *App) InitEmailBatching()

func (*App) InitPlugins

func (a *App) InitPlugins(pluginPath, webappPath string, supervisorOverride pluginenv.SupervisorProviderFunc)

func (*App) InstallPlugin

func (a *App) InstallPlugin(pluginFile io.Reader) (*model.Manifest, *model.AppError)

InstallPlugin unpacks and installs a plugin but does not activate it.

func (*App) InvalidateAllCaches

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

func (*App) InvalidateAllCachesSkipSend

func (a *App) InvalidateAllCachesSkipSend()

func (*App) InvalidateCacheForChannel

func (a *App) InvalidateCacheForChannel(channel *model.Channel)

func (*App) InvalidateCacheForChannelByNameSkipClusterSend

func (a *App) InvalidateCacheForChannelByNameSkipClusterSend(teamId, name string)

func (*App) InvalidateCacheForChannelMembers

func (a *App) InvalidateCacheForChannelMembers(channelId string)

func (*App) InvalidateCacheForChannelMembersNotifyProps

func (a *App) InvalidateCacheForChannelMembersNotifyProps(channelId string)

func (*App) InvalidateCacheForChannelMembersNotifyPropsSkipClusterSend

func (a *App) InvalidateCacheForChannelMembersNotifyPropsSkipClusterSend(channelId string)

func (*App) InvalidateCacheForChannelMembersSkipClusterSend

func (a *App) InvalidateCacheForChannelMembersSkipClusterSend(channelId string)

func (*App) InvalidateCacheForChannelPosts

func (a *App) InvalidateCacheForChannelPosts(channelId string)

func (*App) InvalidateCacheForChannelPostsSkipClusterSend

func (a *App) InvalidateCacheForChannelPostsSkipClusterSend(channelId string)

func (*App) InvalidateCacheForChannelSkipClusterSend

func (a *App) InvalidateCacheForChannelSkipClusterSend(channelId string)

func (*App) InvalidateCacheForUser

func (a *App) InvalidateCacheForUser(userId string)

func (*App) InvalidateCacheForUserSkipClusterSend

func (a *App) InvalidateCacheForUserSkipClusterSend(userId string)

func (*App) InvalidateCacheForWebhook

func (a *App) InvalidateCacheForWebhook(webhookId string)

func (*App) InvalidateCacheForWebhookSkipClusterSend

func (a *App) InvalidateCacheForWebhookSkipClusterSend(webhookId string)

func (*App) InvalidateWebConnSessionCacheForUser

func (a *App) InvalidateWebConnSessionCacheForUser(userId string)

func (*App) InviteNewUsersToTeam

func (a *App) InviteNewUsersToTeam(emailList []string, teamId, senderId string) *model.AppError

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) 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

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

func (*App) JoinChannel

func (a *App) JoinChannel(channel *model.Channel, userId string) *model.AppError

func (*App) JoinDefaultChannels

func (a *App) JoinDefaultChannels(teamId string, user *model.User, channelRole string, userRequestorId string) *model.AppError

func (*App) JoinUserToTeam

func (a *App) JoinUserToTeam(team *model.Team, user *model.User, userRequestorId string) *model.AppError

func (*App) LeaveChannel

func (a *App) LeaveChannel(channelId string, userId string) *model.AppError

func (*App) LeaveTeam

func (a *App) LeaveTeam(team *model.Team, user *model.User, requestorId string) *model.AppError

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)

previous ListCommands now ListAutocompleteCommands

func (*App) ListTeamCommands

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

func (*App) Listen

func (a *App) Listen(addr string) (net.Listener, error)

func (*App) LoadLicense

func (a *App) LoadLicense()

func (*App) LoginByOAuth

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

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) MoveChannel

func (a *App) MoveChannel(team *model.Team, channel *model.Channel) *model.AppError

This function is intended for use from the CLI. It is not robust against people joining the channel while the move is in progress, and therefore should not be used from the API without first fixing this potential race condition.

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) NewEmailTemplate

func (a *App) NewEmailTemplate(name, locale string) *utils.HTMLTemplate

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) OldImportChannel

func (a *App) OldImportChannel(channel *model.Channel) *model.Channel

func (*App) OldImportFile

func (a *App) OldImportFile(timestamp time.Time, file io.Reader, teamId string, channelId string, userId string, fileName string) (*model.FileInfo, error)

func (*App) OldImportIncomingWebhookPost

func (a *App) OldImportIncomingWebhookPost(post *model.Post, props model.StringInterface)

func (*App) OldImportPost

func (a *App) OldImportPost(post *model.Post)

func (*App) OldImportUser

func (a *App) OldImportUser(team *model.Team, user *model.User) *model.User

func (*App) OriginChecker

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

func (*App) PatchChannel

func (a *App) PatchChannel(channel *model.Channel, patch *model.ChannelPatch, userId string) (*model.Channel, *model.AppError)

func (*App) PatchPost

func (a *App) PatchPost(postId string, patch *model.PostPatch) (*model.Post, *model.AppError)

func (*App) PatchTeam

func (a *App) PatchTeam(teamId string, patch *model.TeamPatch) (*model.Team, *model.AppError)

func (*App) PatchUser

func (a *App) PatchUser(userId string, patch *model.UserPatch, asAdmin bool) (*model.User, *model.AppError)

func (*App) PermanentDeleteAllUsers

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

func (*App) PermanentDeleteChannel

func (a *App) PermanentDeleteChannel(channel *model.Channel) *model.AppError

func (*App) PermanentDeleteTeam

func (a *App) PermanentDeleteTeam(team *model.Team) *model.AppError

func (*App) PermanentDeleteTeamId

func (a *App) PermanentDeleteTeamId(teamId string) *model.AppError

func (*App) PermanentDeleteUser

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

func (*App) PersistConfig

func (a *App) PersistConfig()

func (*App) PluginCommandsForTeam

func (a *App) PluginCommandsForTeam(teamId string) []*model.Command

func (*App) PostAddToChannelMessage

func (a *App) PostAddToChannelMessage(user *model.User, addedUser *model.User, channel *model.Channel, postRootId string) *model.AppError

func (*App) PostUpdateChannelDisplayNameMessage

func (a *App) PostUpdateChannelDisplayNameMessage(userId string, channel *model.Channel, oldChannelDisplayName, newChannelDisplayName string) *model.AppError

func (*App) PostUpdateChannelHeaderMessage

func (a *App) PostUpdateChannelHeaderMessage(userId string, channel *model.Channel, oldChannelHeader, newChannelHeader string) *model.AppError

func (*App) PostUpdateChannelPurposeMessage

func (a *App) PostUpdateChannelPurposeMessage(userId string, channel *model.Channel, oldChannelPurpose string, newChannelPurpose string) *model.AppError

func (*App) ProcessSlackAttachments

func (app *App) ProcessSlackAttachments(a []*model.SlackAttachment) []*model.SlackAttachment

Expand announcements in incoming webhooks from Slack. Those announcements can be found in the text attribute, or in the pretext, text, title and value attributes of the attachment structure. The Slack attachment structure is documented here: https://api.slack.com/docs/attachments

func (*App) ProcessSlackText

func (a *App) ProcessSlackText(text string) string

func (*App) Publish

func (a *App) Publish(message *model.WebSocketEvent)

func (*App) PublishSkipClusterSend

func (a *App) PublishSkipClusterSend(message *model.WebSocketEvent)

func (*App) PurgeElasticsearchIndexes

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

func (*App) ReadFile

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

func (*App) RecycleDatabaseConnection

func (a *App) RecycleDatabaseConnection()

func (*App) RegenCommandToken

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

func (*App) RegenOutgoingWebhookToken

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

func (*App) RegenerateOAuthAppSecret

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

func (*App) RegisterAllClusterMessageHandlers

func (a *App) RegisterAllClusterMessageHandlers()

func (*App) RegisterPluginCommand

func (a *App) RegisterPluginCommand(pluginId string, command *model.Command) error

func (*App) ReloadConfig

func (a *App) ReloadConfig()

func (*App) RemoveFile

func (a *App) RemoveFile(path string) *model.AppError

func (*App) RemoveLicense

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

func (*App) RemovePlugin

func (a *App) RemovePlugin(id string) *model.AppError

func (*App) RemoveSamlIdpCertificate

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

func (*App) RemoveSamlPrivateCertificate

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

func (*App) RemoveSamlPublicCertificate

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

func (*App) RemoveUserFromChannel

func (a *App) RemoveUserFromChannel(userIdToRemove string, removerUserId string, channel *model.Channel) *model.AppError

func (*App) RemoveUserFromTeam

func (a *App) RemoveUserFromTeam(teamId string, userId string, requestorId string) *model.AppError

func (*App) ResetPasswordFromToken

func (a *App) ResetPasswordFromToken(userSuppliedTokenString, newPassword string) *model.AppError

func (*App) RestoreChannel

func (a *App) RestoreChannel(channel *model.Channel) (*model.Channel, *model.AppError)

func (*App) RevokeAccessToken

func (a *App) RevokeAccessToken(token string) *model.AppError

func (*App) RevokeAllSessions

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

func (*App) RevokeSession

func (a *App) RevokeSession(session *model.Session) *model.AppError

func (*App) RevokeSessionById

func (a *App) RevokeSessionById(sessionId string) *model.AppError

func (*App) RevokeSessionsForDeviceId

func (a *App) RevokeSessionsForDeviceId(userId string, deviceId string, currentSessionId string) *model.AppError

func (*App) RevokeUserAccessToken

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

func (*App) RevokeWebrtcToken

func (a *App) RevokeWebrtcToken(sessionId string)

func (*App) Role

func (a *App) Role(id string) *model.Role

func (*App) SanitizeProfile

func (a *App) SanitizeProfile(user *model.User, asAdmin bool)

func (*App) SanitizeTeam

func (a *App) SanitizeTeam(session model.Session, team *model.Team) *model.Team

func (*App) SanitizeTeams

func (a *App) SanitizeTeams(session model.Session, teams []*model.Team) []*model.Team

func (*App) SaveBrandImage

func (a *App) SaveBrandImage(imageData *multipart.FileHeader) *model.AppError

func (*App) SaveComplianceReport

func (a *App) SaveComplianceReport(job *model.Compliance) (*model.Compliance, *model.AppError)

func (*App) SaveConfig

func (a *App) SaveConfig(cfg *model.Config, sendConfigChangeClusterMessage bool) *model.AppError

func (*App) SaveLicense

func (a *App) SaveLicense(licenseBytes []byte) (*model.License, *model.AppError)

func (*App) SaveReactionForPost

func (a *App) SaveReactionForPost(reaction *model.Reaction) (*model.Reaction, *model.AppError)

func (*App) SearchAllTeams

func (a *App) SearchAllTeams(term string) ([]*model.Team, *model.AppError)

func (*App) SearchChannels

func (a *App) SearchChannels(teamId string, term string) (*model.ChannelList, *model.AppError)

func (*App) SearchChannelsUserNotIn

func (a *App) SearchChannelsUserNotIn(teamId string, userId string, term string) (*model.ChannelList, *model.AppError)

func (*App) SearchOpenTeams

func (a *App) SearchOpenTeams(term string) ([]*model.Team, *model.AppError)

func (*App) SearchPostsInTeam

func (a *App) SearchPostsInTeam(terms string, userId string, teamId string, isOrSearch bool) (*model.PostList, *model.AppError)

func (*App) SearchUsers

func (a *App) SearchUsers(props *model.UserSearch, searchOptions map[string]bool, asAdmin bool) ([]*model.User, *model.AppError)

func (*App) SearchUsersInChannel

func (a *App) SearchUsersInChannel(channelId string, term string, searchOptions map[string]bool, asAdmin bool) ([]*model.User, *model.AppError)

func (*App) SearchUsersInTeam

func (a *App) SearchUsersInTeam(teamId string, term string, searchOptions map[string]bool, asAdmin bool) ([]*model.User, *model.AppError)

func (*App) SearchUsersNotInChannel

func (a *App) SearchUsersNotInChannel(teamId string, channelId string, term string, searchOptions map[string]bool, asAdmin bool) ([]*model.User, *model.AppError)

func (*App) SearchUsersNotInTeam

func (a *App) SearchUsersNotInTeam(notInTeamId string, term string, searchOptions map[string]bool, asAdmin bool) ([]*model.User, *model.AppError)

func (*App) SearchUsersWithoutTeam

func (a *App) SearchUsersWithoutTeam(term string, searchOptions map[string]bool, asAdmin bool) ([]*model.User, *model.AppError)

func (*App) SendChangeUsernameEmail

func (a *App) SendChangeUsernameEmail(oldUsername, newUsername, email, locale, siteURL string) *model.AppError

func (*App) SendDailyDiagnostics

func (a *App) SendDailyDiagnostics()

func (*App) SendEmailChangeEmail

func (a *App) SendEmailChangeEmail(oldEmail, newEmail, locale, siteURL string) *model.AppError

func (*App) SendEmailChangeVerifyEmail

func (a *App) SendEmailChangeVerifyEmail(newUserEmail, locale, siteURL, token string) *model.AppError

func (*App) SendEmailVerification

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

func (*App) SendEphemeralPost

func (a *App) SendEphemeralPost(userId string, post *model.Post) *model.Post

func (*App) SendInviteEmails

func (a *App) SendInviteEmails(team *model.Team, senderName string, invites []string, siteURL string)

func (*App) SendMail

func (a *App) SendMail(to, subject, htmlBody string) *model.AppError

func (*App) SendMfaChangeEmail

func (a *App) SendMfaChangeEmail(email string, activated bool, locale, siteURL string) *model.AppError

func (*App) SendNotifications

func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *model.Channel, sender *model.User, parentPostList *model.PostList) ([]string, *model.AppError)

func (*App) SendPasswordChangeEmail

func (a *App) SendPasswordChangeEmail(email, method, locale, siteURL string) *model.AppError

func (*App) SendPasswordReset

func (a *App) SendPasswordReset(email string, siteURL string) (bool, *model.AppError)

func (*App) SendPasswordResetEmail

func (a *App) SendPasswordResetEmail(email string, token *model.Token, locale, siteURL string) (bool, *model.AppError)

func (*App) SendSignInChangeEmail

func (a *App) SendSignInChangeEmail(email, method, locale, siteURL string) *model.AppError

func (*App) SendUserAccessTokenAddedEmail

func (a *App) SendUserAccessTokenAddedEmail(email, locale string) *model.AppError

func (*App) SendVerifyEmail

func (a *App) SendVerifyEmail(userEmail, locale, siteURL, token string) *model.AppError

func (*App) SendWelcomeEmail

func (a *App) SendWelcomeEmail(userId string, email string, verified bool, locale, siteURL string) *model.AppError

func (*App) ServePluginRequest

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

func (*App) SessionCacheLength

func (a *App) SessionCacheLength() int

func (*App) SessionHasPermissionTo

func (a *App) SessionHasPermissionTo(session model.Session, permission *model.Permission) bool

func (*App) SessionHasPermissionToChannel

func (a *App) SessionHasPermissionToChannel(session model.Session, channelId string, permission *model.Permission) bool

func (*App) SessionHasPermissionToChannelByPost

func (a *App) SessionHasPermissionToChannelByPost(session model.Session, postId string, permission *model.Permission) bool

func (*App) SessionHasPermissionToPost

func (a *App) SessionHasPermissionToPost(session model.Session, postId string, permission *model.Permission) bool

func (*App) SessionHasPermissionToTeam

func (a *App) SessionHasPermissionToTeam(session model.Session, teamId string, permission *model.Permission) bool

/ DO NOT USE: LEGACY

func (*App) SessionHasPermissionToUser

func (a *App) SessionHasPermissionToUser(session model.Session, userId string) bool

func (*App) SetActiveChannel

func (a *App) SetActiveChannel(userId string, channelId string) *model.AppError

func (*App) SetDefaultRolesBasedOnConfig

func (a *App) SetDefaultRolesBasedOnConfig()

Updates the roles based on the app config and the global license check. You may need to invoke this when license changes are made.

func (*App) SetPluginKey

func (a *App) SetPluginKey(pluginId string, key string, value []byte) *model.AppError

func (*App) SetProfileImage

func (a *App) SetProfileImage(userId string, imageData *multipart.FileHeader) *model.AppError

func (*App) SetStatusAwayIfNeeded

func (a *App) SetStatusAwayIfNeeded(userId string, manual bool)

func (*App) SetStatusDoNotDisturb

func (a *App) SetStatusDoNotDisturb(userId string)

func (*App) SetStatusOffline

func (a *App) SetStatusOffline(userId string, manual bool)

func (*App) SetStatusOnline

func (a *App) SetStatusOnline(userId string, sessionId string, manual bool)

func (*App) ShutDownPlugins

func (a *App) ShutDownPlugins()

func (*App) Shutdown

func (a *App) Shutdown()

func (*App) SlackAddBotUser

func (a *App) SlackAddBotUser(teamId string, log *bytes.Buffer) *model.User

func (*App) SlackAddChannels

func (a *App) SlackAddChannels(teamId string, slackchannels []SlackChannel, posts map[string][]SlackPost, users map[string]*model.User, uploads map[string]*zip.File, botUser *model.User, log *bytes.Buffer) map[string]*model.Channel

func (*App) SlackAddPosts

func (a *App) SlackAddPosts(teamId string, channel *model.Channel, posts []SlackPost, users map[string]*model.User, uploads map[string]*zip.File, botUser *model.User)

func (*App) SlackAddUsers

func (a *App) SlackAddUsers(teamId string, slackusers []SlackUser, log *bytes.Buffer) map[string]*model.User

func (*App) SlackImport

func (a *App) SlackImport(fileData multipart.File, fileSize int64, teamID string) (*model.AppError, *bytes.Buffer)

func (*App) SlackUploadFile

func (a *App) SlackUploadFile(sPost SlackPost, uploads map[string]*zip.File, teamId string, channelId string, userId string) (*model.FileInfo, bool)

func (*App) SoftDeleteTeam

func (a *App) SoftDeleteTeam(teamId string) *model.AppError

func (*App) StartServer

func (a *App) StartServer()

func (*App) StopServer

func (a *App) StopServer()

func (*App) SwitchEmailToLdap

func (a *App) SwitchEmailToLdap(email, password, code, ldapId, ldapPassword string) (string, *model.AppError)

func (*App) SwitchEmailToOAuth

func (a *App) SwitchEmailToOAuth(w http.ResponseWriter, r *http.Request, email, password, code, service string) (string, *model.AppError)

func (*App) SwitchLdapToEmail

func (a *App) SwitchLdapToEmail(ldapPassword, code, email, newPassword string) (string, *model.AppError)

func (*App) SwitchOAuthToEmail

func (a *App) SwitchOAuthToEmail(email, password, requesterId string) (string, *model.AppError)

func (*App) SyncLdap

func (a *App) SyncLdap()

func (*App) TestElasticsearch

func (a *App) TestElasticsearch(cfg *model.Config) *model.AppError

func (*App) TestEmail

func (a *App) TestEmail(userId string, cfg *model.Config) *model.AppError

func (*App) TestLdap

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

func (*App) TotalWebsocketConnections

func (a *App) TotalWebsocketConnections() int

func (*App) TriggerWebhook

func (a *App) TriggerWebhook(payload *model.OutgoingWebhookPayload, hook *model.OutgoingWebhook, post *model.Post, channel *model.Channel)

func (*App) UnregisterPluginCommand

func (a *App) UnregisterPluginCommand(pluginId, teamId, trigger string)

func (*App) UnregisterPluginCommands

func (a *App) UnregisterPluginCommands(pluginId string)

func (*App) UpdateActive

func (a *App) UpdateActive(user *model.User, active bool) (*model.User, *model.AppError)

func (*App) UpdateChannel

func (a *App) UpdateChannel(channel *model.Channel) (*model.Channel, *model.AppError)

func (*App) UpdateChannelLastViewedAt

func (a *App) UpdateChannelLastViewedAt(channelIds []string, userId string) *model.AppError

func (*App) UpdateChannelMemberNotifyProps

func (a *App) UpdateChannelMemberNotifyProps(data map[string]string, channelId string, userId string) (*model.ChannelMember, *model.AppError)

func (*App) UpdateChannelMemberRoles

func (a *App) UpdateChannelMemberRoles(channelId string, userId string, newRoles string) (*model.ChannelMember, *model.AppError)

func (*App) UpdateCommand

func (a *App) UpdateCommand(oldCmd, updatedCmd *model.Command) (*model.Command, *model.AppError)

func (*App) UpdateConfig

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

func (*App) UpdateIncomingWebhook

func (a *App) UpdateIncomingWebhook(oldHook, updatedHook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError)

func (*App) UpdateLastActivityAtIfNeeded

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

func (*App) UpdateMfa

func (a *App) UpdateMfa(activate bool, userId, token string) *model.AppError

func (*App) UpdateNonSSOUserActive

func (a *App) UpdateNonSSOUserActive(userId string, active bool) (*model.User, *model.AppError)

func (*App) UpdateOAuthUserAttrs

func (a *App) UpdateOAuthUserAttrs(userData io.Reader, user *model.User, provider einterfaces.OauthProvider, service string) *model.AppError

func (*App) UpdateOauthApp

func (a *App) UpdateOauthApp(oldApp, updatedApp *model.OAuthApp) (*model.OAuthApp, *model.AppError)

func (*App) UpdateOutgoingWebhook

func (a *App) UpdateOutgoingWebhook(oldHook, updatedHook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError)

func (*App) UpdatePassword

func (a *App) UpdatePassword(user *model.User, newPassword string) *model.AppError

func (*App) UpdatePasswordAsUser

func (a *App) UpdatePasswordAsUser(userId, currentPassword, newPassword string) *model.AppError

func (*App) UpdatePasswordByUserIdSendEmail

func (a *App) UpdatePasswordByUserIdSendEmail(userId, newPassword, method string) *model.AppError

func (*App) UpdatePasswordSendEmail

func (a *App) UpdatePasswordSendEmail(user *model.User, newPassword, method string) *model.AppError

func (*App) UpdatePost

func (a *App) UpdatePost(post *model.Post, safeUpdate bool) (*model.Post, *model.AppError)

func (*App) UpdatePreferences

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

func (*App) UpdateTeam

func (a *App) UpdateTeam(team *model.Team) (*model.Team, *model.AppError)

func (*App) UpdateTeamMemberRoles

func (a *App) UpdateTeamMemberRoles(teamId string, userId string, newRoles string) (*model.TeamMember, *model.AppError)

func (*App) UpdateUser

func (a *App) UpdateUser(user *model.User, sendNotifications bool) (*model.User, *model.AppError)

func (*App) UpdateUserAsUser

func (a *App) UpdateUserAsUser(user *model.User, asAdmin bool) (*model.User, *model.AppError)

func (*App) UpdateUserAuth

func (a *App) UpdateUserAuth(userId string, userAuth *model.UserAuth) (*model.UserAuth, *model.AppError)

func (*App) UpdateUserNotifyProps

func (a *App) UpdateUserNotifyProps(userId string, props map[string]string) (*model.User, *model.AppError)

func (*App) UpdateUserRoles

func (a *App) UpdateUserRoles(userId string, newRoles string, sendWebSocketEvent bool) (*model.User, *model.AppError)

func (*App) UploadEmojiImage

func (a *App) UploadEmojiImage(id string, imageData *multipart.FileHeader) *model.AppError

func (*App) UploadFiles

func (a *App) UploadFiles(teamId string, channelId string, userId string, fileHeaders []*multipart.FileHeader, clientIds []string) (*model.FileUploadResponse, *model.AppError)

func (*App) VerifyEmailFromToken

func (a *App) VerifyEmailFromToken(userSuppliedTokenString string) *model.AppError

func (*App) VerifyUserEmail

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

func (*App) ViewChannel

func (a *App) ViewChannel(view *model.ChannelView, userId string, clearPushNotifications bool) (map[string]int64, *model.AppError)

func (*App) WaitForChannelMembership

func (a *App) WaitForChannelMembership(channelId string, userId string)

func (*App) WaitForGoroutines

func (a *App) WaitForGoroutines()

WaitForGoroutines blocks until all goroutines created by App.Go exit.

func (*App) WriteFile

func (a *App) WriteFile(f []byte, path string) *model.AppError

type AutoChannelCreator

type AutoChannelCreator struct {
	Fuzzy              bool
	DisplayNameLen     utils.Range
	DisplayNameCharset string
	NameLen            utils.Range
	NameCharset        string
	ChannelType        string
	// contains filtered or unexported fields
}

func NewAutoChannelCreator

func NewAutoChannelCreator(client *model.Client, team *model.Team) *AutoChannelCreator

func (*AutoChannelCreator) CreateTestChannels

func (cfg *AutoChannelCreator) CreateTestChannels(num utils.Range) ([]*model.Channel, bool)

type AutoPostCreator

type AutoPostCreator struct {
	Fuzzy          bool
	TextLength     utils.Range
	HasImage       bool
	ImageFilenames []string
	Users          []string
	Mentions       utils.Range
	Tags           utils.Range
	// contains filtered or unexported fields
}

func NewAutoPostCreator

func NewAutoPostCreator(client *model.Client, channelid string) *AutoPostCreator

Automatic poster used for testing

func (*AutoPostCreator) CreateRandomPost

func (cfg *AutoPostCreator) CreateRandomPost() (*model.Post, bool)

func (*AutoPostCreator) CreateTestPosts

func (cfg *AutoPostCreator) CreateTestPosts(rangePosts utils.Range) ([]*model.Post, bool)

func (*AutoPostCreator) UploadTestFile

func (cfg *AutoPostCreator) UploadTestFile() ([]string, bool)

type AutoTeamCreator

type AutoTeamCreator struct {
	Fuzzy         bool
	NameLength    utils.Range
	NameCharset   string
	DomainLength  utils.Range
	DomainCharset string
	EmailLength   utils.Range
	EmailCharset  string
	// contains filtered or unexported fields
}

func NewAutoTeamCreator

func NewAutoTeamCreator(client *model.Client) *AutoTeamCreator

func (*AutoTeamCreator) CreateTestTeams

func (cfg *AutoTeamCreator) CreateTestTeams(num utils.Range) ([]*model.Team, bool)

type AutoUserCreator

type AutoUserCreator struct {
	EmailLength  utils.Range
	EmailCharset string
	NameLength   utils.Range
	NameCharset  string
	Fuzzy        bool
	// contains filtered or unexported fields
}

func NewAutoUserCreator

func NewAutoUserCreator(a *App, client *model.Client, team *model.Team) *AutoUserCreator

func (*AutoUserCreator) CreateTestUsers

func (cfg *AutoUserCreator) CreateTestUsers(num utils.Range) ([]*model.User, bool)

type AwayProvider

type AwayProvider struct {
}

func (*AwayProvider) DoCommand

func (me *AwayProvider) DoCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse

func (*AwayProvider) GetCommand

func (me *AwayProvider) GetCommand(a *App, T goi18n.TranslateFunc) *model.Command

func (*AwayProvider) GetTrigger

func (me *AwayProvider) GetTrigger() string

type BuiltInPluginAPI

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

func (*BuiltInPluginAPI) CreatePost

func (api *BuiltInPluginAPI) CreatePost(post *model.Post) (*model.Post, *model.AppError)

func (*BuiltInPluginAPI) GetChannelByName

func (api *BuiltInPluginAPI) GetChannelByName(teamId, name string) (*model.Channel, *model.AppError)

func (*BuiltInPluginAPI) GetDirectChannel

func (api *BuiltInPluginAPI) GetDirectChannel(userId1, userId2 string) (*model.Channel, *model.AppError)

func (*BuiltInPluginAPI) GetLdapUserAttributes

func (api *BuiltInPluginAPI) GetLdapUserAttributes(userId string, attributes []string) (map[string]string, *model.AppError)

func (*BuiltInPluginAPI) GetSessionFromRequest

func (api *BuiltInPluginAPI) GetSessionFromRequest(r *http.Request) (*model.Session, *model.AppError)

func (*BuiltInPluginAPI) GetTeamByName

func (api *BuiltInPluginAPI) GetTeamByName(name string) (*model.Team, *model.AppError)

func (*BuiltInPluginAPI) GetUserByName

func (api *BuiltInPluginAPI) GetUserByName(name string) (*model.User, *model.AppError)

func (*BuiltInPluginAPI) I18n

func (api *BuiltInPluginAPI) I18n(id string, r *http.Request) string

func (*BuiltInPluginAPI) LoadPluginConfiguration

func (api *BuiltInPluginAPI) LoadPluginConfiguration(dest interface{}) error

func (*BuiltInPluginAPI) PluginRouter

func (api *BuiltInPluginAPI) PluginRouter() *mux.Router

type ChannelImportData

type ChannelImportData struct {
	Team        *string `json:"team"`
	Name        *string `json:"name"`
	DisplayName *string `json:"display_name"`
	Type        *string `json:"type"`
	Header      *string `json:"header"`
	Purpose     *string `json:"purpose"`
}

type ClusterDiscoveryService

type ClusterDiscoveryService struct {
	model.ClusterDiscovery
	// contains filtered or unexported fields
}

func (*ClusterDiscoveryService) Start

func (me *ClusterDiscoveryService) Start()

func (*ClusterDiscoveryService) Stop

func (me *ClusterDiscoveryService) Stop()

type CodeProvider

type CodeProvider struct {
}

func (*CodeProvider) DoCommand

func (me *CodeProvider) DoCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse

func (*CodeProvider) GetCommand

func (me *CodeProvider) GetCommand(a *App, T goi18n.TranslateFunc) *model.Command

func (*CodeProvider) GetTrigger

func (me *CodeProvider) GetTrigger() string

type CollapseProvider

type CollapseProvider struct {
}

func (*CollapseProvider) DoCommand

func (me *CollapseProvider) DoCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse

func (*CollapseProvider) GetCommand

func (me *CollapseProvider) GetCommand(a *App, T goi18n.TranslateFunc) *model.Command

func (*CollapseProvider) GetTrigger

func (me *CollapseProvider) GetTrigger() string

type CommandProvider

type CommandProvider interface {
	GetTrigger() string
	GetCommand(a *App, T goi18n.TranslateFunc) *model.Command
	DoCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse
}

func GetCommandProvider

func GetCommandProvider(name string) CommandProvider

type CorsWrapper

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

func (*CorsWrapper) ServeHTTP

func (cw *CorsWrapper) ServeHTTP(w http.ResponseWriter, r *http.Request)

type DirectChannelImportData

type DirectChannelImportData struct {
	Members     *[]string `json:"members"`
	FavoritedBy *[]string `json:"favorited_by"`

	Header *string `json:"header"`
}

type DirectPostImportData

type DirectPostImportData struct {
	ChannelMembers *[]string `json:"channel_members"`
	User           *string   `json:"user"`

	Message  *string `json:"message"`
	CreateAt *int64  `json:"create_at"`

	FlaggedBy *[]string `json:"flagged_by"`
}

type DndProvider

type DndProvider struct {
}

func (*DndProvider) DoCommand

func (me *DndProvider) DoCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse

func (*DndProvider) GetCommand

func (me *DndProvider) GetCommand(a *App, T goi18n.TranslateFunc) *model.Command

func (*DndProvider) GetTrigger

func (me *DndProvider) GetTrigger() string

type EchoProvider

type EchoProvider struct {
}

func (*EchoProvider) DoCommand

func (me *EchoProvider) DoCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse

func (*EchoProvider) GetCommand

func (me *EchoProvider) GetCommand(a *App, T goi18n.TranslateFunc) *model.Command

func (*EchoProvider) GetTrigger

func (me *EchoProvider) GetTrigger() string

type EmailBatchingJob

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

func NewEmailBatchingJob

func NewEmailBatchingJob(a *App, bufferSize int) *EmailBatchingJob

func (*EmailBatchingJob) Add

func (job *EmailBatchingJob) Add(user *model.User, post *model.Post, team *model.Team) bool

func (*EmailBatchingJob) CheckPendingEmails

func (job *EmailBatchingJob) CheckPendingEmails()

func (*EmailBatchingJob) Start

func (job *EmailBatchingJob) Start()

type ExpandProvider

type ExpandProvider struct {
}

func (*ExpandProvider) DoCommand

func (me *ExpandProvider) DoCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse

func (*ExpandProvider) GetCommand

func (me *ExpandProvider) GetCommand(a *App, T goi18n.TranslateFunc) *model.Command

func (*ExpandProvider) GetTrigger

func (me *ExpandProvider) GetTrigger() string

type HeaderProvider

type HeaderProvider struct {
}

func (*HeaderProvider) DoCommand

func (me *HeaderProvider) DoCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse

func (*HeaderProvider) GetCommand

func (me *HeaderProvider) GetCommand(a *App, T goi18n.TranslateFunc) *model.Command

func (*HeaderProvider) GetTrigger

func (me *HeaderProvider) GetTrigger() string

type HelpProvider

type HelpProvider struct {
}

func (*HelpProvider) DoCommand

func (h *HelpProvider) DoCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse

func (*HelpProvider) GetCommand

func (h *HelpProvider) GetCommand(a *App, T goi18n.TranslateFunc) *model.Command

func (*HelpProvider) GetTrigger

func (h *HelpProvider) GetTrigger() string

type Hub

type Hub struct {
	ExplicitStop bool
	// contains filtered or unexported fields
}

func (*Hub) Broadcast

func (h *Hub) Broadcast(message *model.WebSocketEvent)

func (*Hub) InvalidateUser

func (h *Hub) InvalidateUser(userId string)

func (*Hub) Register

func (h *Hub) Register(webConn *WebConn)

func (*Hub) Start

func (h *Hub) Start()

func (*Hub) Stop

func (h *Hub) Stop()

func (*Hub) Unregister

func (h *Hub) Unregister(webConn *WebConn)

type InvitePeopleProvider

type InvitePeopleProvider struct {
}

func (*InvitePeopleProvider) DoCommand

func (me *InvitePeopleProvider) DoCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse

func (*InvitePeopleProvider) GetCommand

func (me *InvitePeopleProvider) GetCommand(a *App, T goi18n.TranslateFunc) *model.Command

func (*InvitePeopleProvider) GetTrigger

func (me *InvitePeopleProvider) GetTrigger() string

type JoinProvider

type JoinProvider struct {
}

func (*JoinProvider) DoCommand

func (me *JoinProvider) DoCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse

func (*JoinProvider) GetCommand

func (me *JoinProvider) GetCommand(a *App, T goi18n.TranslateFunc) *model.Command

func (*JoinProvider) GetTrigger

func (me *JoinProvider) GetTrigger() string

type KickProvider

type KickProvider struct {
}

func (*KickProvider) DoCommand

func (me *KickProvider) DoCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse

func (*KickProvider) GetCommand

func (me *KickProvider) GetCommand(a *App, T goi18n.TranslateFunc) *model.Command

func (*KickProvider) GetTrigger

func (me *KickProvider) GetTrigger() string

type LeaveProvider

type LeaveProvider struct {
}

func (*LeaveProvider) DoCommand

func (me *LeaveProvider) DoCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse

func (*LeaveProvider) GetCommand

func (me *LeaveProvider) GetCommand(a *App, T goi18n.TranslateFunc) *model.Command

func (*LeaveProvider) GetTrigger

func (me *LeaveProvider) GetTrigger() string

type LineImportData

type LineImportData struct {
	Type          string                   `json:"type"`
	Team          *TeamImportData          `json:"team"`
	Channel       *ChannelImportData       `json:"channel"`
	User          *UserImportData          `json:"user"`
	Post          *PostImportData          `json:"post"`
	DirectChannel *DirectChannelImportData `json:"direct_channel"`
	DirectPost    *DirectPostImportData    `json:"direct_post"`
	Version       *int                     `json:"version"`
}

type LineImportWorkerData

type LineImportWorkerData struct {
	LineImportData
	LineNumber int
}

type LineImportWorkerError

type LineImportWorkerError struct {
	Error      *model.AppError
	LineNumber int
}

type LoadTestProvider

type LoadTestProvider struct {
}

func (*LoadTestProvider) ChannelsCommand

func (me *LoadTestProvider) ChannelsCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse

func (*LoadTestProvider) DoCommand

func (me *LoadTestProvider) DoCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse

func (*LoadTestProvider) GetCommand

func (me *LoadTestProvider) GetCommand(a *App, T goi18n.TranslateFunc) *model.Command

func (*LoadTestProvider) GetTrigger

func (me *LoadTestProvider) GetTrigger() string

func (*LoadTestProvider) HelpCommand

func (me *LoadTestProvider) HelpCommand(args *model.CommandArgs, message string) *model.CommandResponse

func (*LoadTestProvider) JsonCommand

func (me *LoadTestProvider) JsonCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse

func (*LoadTestProvider) PostsCommand

func (me *LoadTestProvider) PostsCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse

func (*LoadTestProvider) SetupCommand

func (me *LoadTestProvider) SetupCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse

func (*LoadTestProvider) UrlCommand

func (me *LoadTestProvider) UrlCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse

func (*LoadTestProvider) UsersCommand

func (me *LoadTestProvider) UsersCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse

type LogoutProvider

type LogoutProvider struct {
}

func (*LogoutProvider) DoCommand

func (me *LogoutProvider) DoCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse

func (*LogoutProvider) GetCommand

func (me *LogoutProvider) GetCommand(a *App, T goi18n.TranslateFunc) *model.Command

func (*LogoutProvider) GetTrigger

func (me *LogoutProvider) GetTrigger() string

type MeProvider

type MeProvider struct {
}

func (*MeProvider) DoCommand

func (me *MeProvider) DoCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse

func (*MeProvider) GetCommand

func (me *MeProvider) GetCommand(a *App, T goi18n.TranslateFunc) *model.Command

func (*MeProvider) GetTrigger

func (me *MeProvider) GetTrigger() string

type OfflineProvider

type OfflineProvider struct {
}

func (*OfflineProvider) DoCommand

func (me *OfflineProvider) DoCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse

func (*OfflineProvider) GetCommand

func (me *OfflineProvider) GetCommand(a *App, T goi18n.TranslateFunc) *model.Command

func (*OfflineProvider) GetTrigger

func (me *OfflineProvider) GetTrigger() string

type OnlineProvider

type OnlineProvider struct {
}

func (*OnlineProvider) DoCommand

func (me *OnlineProvider) DoCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse

func (*OnlineProvider) GetCommand

func (me *OnlineProvider) GetCommand(a *App, T goi18n.TranslateFunc) *model.Command

func (*OnlineProvider) GetTrigger

func (me *OnlineProvider) GetTrigger() string

type OpenProvider

type OpenProvider struct {
	JoinProvider
}

func (*OpenProvider) GetCommand

func (open *OpenProvider) GetCommand(a *App, T goi18n.TranslateFunc) *model.Command

func (*OpenProvider) GetTrigger

func (open *OpenProvider) GetTrigger() string

type Option

type Option func(a *App)

func ConfigFile

func ConfigFile(file string) Option

func StoreOverride

func StoreOverride(override interface{}) Option

By default, the app will use the store specified by the configuration. This allows you to construct an app with a different store.

The override parameter must be either a store.Store or func(App) store.Store.

type PluginAPI

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

func (*PluginAPI) CreateChannel

func (api *PluginAPI) CreateChannel(channel *model.Channel) (*model.Channel, *model.AppError)

func (*PluginAPI) CreatePost

func (api *PluginAPI) CreatePost(post *model.Post) (*model.Post, *model.AppError)

func (*PluginAPI) CreateTeam

func (api *PluginAPI) CreateTeam(team *model.Team) (*model.Team, *model.AppError)

func (*PluginAPI) CreateUser

func (api *PluginAPI) CreateUser(user *model.User) (*model.User, *model.AppError)

func (*PluginAPI) DeleteChannel

func (api *PluginAPI) DeleteChannel(channelId string) *model.AppError

func (*PluginAPI) DeletePost

func (api *PluginAPI) DeletePost(postId string) *model.AppError

func (*PluginAPI) DeleteTeam

func (api *PluginAPI) DeleteTeam(teamId string) *model.AppError

func (*PluginAPI) DeleteUser

func (api *PluginAPI) DeleteUser(userId string) *model.AppError

func (*PluginAPI) GetChannel

func (api *PluginAPI) GetChannel(channelId string) (*model.Channel, *model.AppError)

func (*PluginAPI) GetChannelByName

func (api *PluginAPI) GetChannelByName(name, teamId string) (*model.Channel, *model.AppError)

func (*PluginAPI) GetChannelMember

func (api *PluginAPI) GetChannelMember(channelId, userId string) (*model.ChannelMember, *model.AppError)

func (*PluginAPI) GetDirectChannel

func (api *PluginAPI) GetDirectChannel(userId1, userId2 string) (*model.Channel, *model.AppError)

func (*PluginAPI) GetGroupChannel

func (api *PluginAPI) GetGroupChannel(userIds []string) (*model.Channel, *model.AppError)

func (*PluginAPI) GetPost

func (api *PluginAPI) GetPost(postId string) (*model.Post, *model.AppError)

func (*PluginAPI) GetTeam

func (api *PluginAPI) GetTeam(teamId string) (*model.Team, *model.AppError)

func (*PluginAPI) GetTeamByName

func (api *PluginAPI) GetTeamByName(name string) (*model.Team, *model.AppError)

func (*PluginAPI) GetUser

func (api *PluginAPI) GetUser(userId string) (*model.User, *model.AppError)

func (*PluginAPI) GetUserByEmail

func (api *PluginAPI) GetUserByEmail(email string) (*model.User, *model.AppError)

func (*PluginAPI) GetUserByUsername

func (api *PluginAPI) GetUserByUsername(name string) (*model.User, *model.AppError)

func (*PluginAPI) KeyValueStore

func (api *PluginAPI) KeyValueStore() plugin.KeyValueStore

func (*PluginAPI) LoadPluginConfiguration

func (api *PluginAPI) LoadPluginConfiguration(dest interface{}) error

func (*PluginAPI) RegisterCommand

func (api *PluginAPI) RegisterCommand(command *model.Command) error

func (*PluginAPI) UnregisterCommand

func (api *PluginAPI) UnregisterCommand(teamId, trigger string) error

func (*PluginAPI) UpdateChannel

func (api *PluginAPI) UpdateChannel(channel *model.Channel) (*model.Channel, *model.AppError)

func (*PluginAPI) UpdatePost

func (api *PluginAPI) UpdatePost(post *model.Post) (*model.Post, *model.AppError)

func (*PluginAPI) UpdateTeam

func (api *PluginAPI) UpdateTeam(team *model.Team) (*model.Team, *model.AppError)

func (*PluginAPI) UpdateUser

func (api *PluginAPI) UpdateUser(user *model.User) (*model.User, *model.AppError)

type PluginCommand

type PluginCommand struct {
	Command  *model.Command
	PluginId string
}

type PluginKeyValueStore

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

func (*PluginKeyValueStore) Delete

func (s *PluginKeyValueStore) Delete(key string) *model.AppError

func (*PluginKeyValueStore) Get

func (s *PluginKeyValueStore) Get(key string) ([]byte, *model.AppError)

func (*PluginKeyValueStore) Set

func (s *PluginKeyValueStore) Set(key string, value []byte) *model.AppError

type PostImportData

type PostImportData struct {
	Team    *string `json:"team"`
	Channel *string `json:"channel"`
	User    *string `json:"user"`

	Message  *string `json:"message"`
	CreateAt *int64  `json:"create_at"`

	FlaggedBy *[]string `json:"flagged_by"`
}

type PurposeProvider

type PurposeProvider struct {
}

func (*PurposeProvider) DoCommand

func (me *PurposeProvider) DoCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse

func (*PurposeProvider) GetCommand

func (me *PurposeProvider) GetCommand(a *App, T goi18n.TranslateFunc) *model.Command

func (*PurposeProvider) GetTrigger

func (me *PurposeProvider) GetTrigger() string

type RecoveryLogger

type RecoveryLogger struct {
}

func (*RecoveryLogger) Println

func (rl *RecoveryLogger) Println(i ...interface{})

type RemoveProvider

type RemoveProvider struct {
}

func (*RemoveProvider) DoCommand

func (me *RemoveProvider) DoCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse

func (*RemoveProvider) GetCommand

func (me *RemoveProvider) GetCommand(a *App, T goi18n.TranslateFunc) *model.Command

func (*RemoveProvider) GetTrigger

func (me *RemoveProvider) GetTrigger() string

type RenameProvider

type RenameProvider struct {
}

func (*RenameProvider) DoCommand

func (me *RenameProvider) DoCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse

func (*RenameProvider) GetCommand

func (me *RenameProvider) GetCommand(a *App, T goi18n.TranslateFunc) *model.Command

func (*RenameProvider) GetTrigger

func (me *RenameProvider) GetTrigger() string

type SearchProvider

type SearchProvider struct {
}

func (*SearchProvider) DoCommand

func (search *SearchProvider) DoCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse

func (*SearchProvider) GetCommand

func (search *SearchProvider) GetCommand(a *App, T goi18n.TranslateFunc) *model.Command

func (*SearchProvider) GetTrigger

func (search *SearchProvider) GetTrigger() string

type Server

type Server struct {
	Store           store.Store
	WebSocketRouter *WebSocketRouter
	Router          *mux.Router
	Server          *http.Server
	ListenAddr      *net.TCPAddr
	// contains filtered or unexported fields
}

type SettingsProvider

type SettingsProvider struct {
}

func (*SettingsProvider) DoCommand

func (settings *SettingsProvider) DoCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse

func (*SettingsProvider) GetCommand

func (settings *SettingsProvider) GetCommand(a *App, T goi18n.TranslateFunc) *model.Command

func (*SettingsProvider) GetTrigger

func (settings *SettingsProvider) GetTrigger() string

type ShortcutsProvider

type ShortcutsProvider struct {
}

func (*ShortcutsProvider) DoCommand

func (me *ShortcutsProvider) DoCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse

func (*ShortcutsProvider) GetCommand

func (me *ShortcutsProvider) GetCommand(a *App, T goi18n.TranslateFunc) *model.Command

func (*ShortcutsProvider) GetTrigger

func (me *ShortcutsProvider) GetTrigger() string

type ShrugProvider

type ShrugProvider struct {
}

func (*ShrugProvider) DoCommand

func (me *ShrugProvider) DoCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse

func (*ShrugProvider) GetCommand

func (me *ShrugProvider) GetCommand(a *App, T goi18n.TranslateFunc) *model.Command

func (*ShrugProvider) GetTrigger

func (me *ShrugProvider) GetTrigger() string

type SlackChannel

type SlackChannel struct {
	Id      string            `json:"id"`
	Name    string            `json:"name"`
	Members []string          `json:"members"`
	Topic   map[string]string `json:"topic"`
	Purpose map[string]string `json:"purpose"`
}

func SlackParseChannels

func SlackParseChannels(data io.Reader) ([]SlackChannel, error)

type SlackComment

type SlackComment struct {
	User    string `json:"user"`
	Comment string `json:"comment"`
}

type SlackFile

type SlackFile struct {
	Id    string `json:"id"`
	Title string `json:"title"`
}

type SlackPost

type SlackPost struct {
	User        string                   `json:"user"`
	BotId       string                   `json:"bot_id"`
	BotUsername string                   `json:"username"`
	Text        string                   `json:"text"`
	TimeStamp   string                   `json:"ts"`
	Type        string                   `json:"type"`
	SubType     string                   `json:"subtype"`
	Comment     *SlackComment            `json:"comment"`
	Upload      bool                     `json:"upload"`
	File        *SlackFile               `json:"file"`
	Attachments []*model.SlackAttachment `json:"attachments"`
}

func SlackParsePosts

func SlackParsePosts(data io.Reader) ([]SlackPost, error)

type SlackUser

type SlackUser struct {
	Id       string            `json:"id"`
	Username string            `json:"name"`
	Profile  map[string]string `json:"profile"`
}

func SlackParseUsers

func SlackParseUsers(data io.Reader) ([]SlackUser, error)

type TeamEnvironment

type TeamEnvironment struct {
	Users    []*model.User
	Channels []*model.Channel
}

func CreateTestEnvironmentInTeam

func CreateTestEnvironmentInTeam(a *App, client *model.Client, team *model.Team, rangeChannels utils.Range, rangeUsers utils.Range, rangePosts utils.Range, fuzzy bool) (TeamEnvironment, bool)

type TeamImportData

type TeamImportData struct {
	Name            *string `json:"name"`
	DisplayName     *string `json:"display_name"`
	Type            *string `json:"type"`
	Description     *string `json:"description"`
	AllowOpenInvite *bool   `json:"allow_open_invite"`
}

type TestEnvironment

type TestEnvironment struct {
	Teams        []*model.Team
	Environments []TeamEnvironment
}

func CreateTestEnvironmentWithTeams

func CreateTestEnvironmentWithTeams(a *App, client *model.Client, rangeTeams utils.Range, rangeChannels utils.Range, rangeUsers utils.Range, rangePosts utils.Range, fuzzy bool) (TestEnvironment, bool)

type TestHelper

type TestHelper struct {
	App          *App
	BasicTeam    *model.Team
	BasicUser    *model.User
	BasicUser2   *model.User
	BasicChannel *model.Channel
	BasicPost    *model.Post
	// contains filtered or unexported fields
}

func Setup

func Setup() *TestHelper

func SetupEnterprise

func SetupEnterprise() *TestHelper

func (*TestHelper) CreateChannel

func (me *TestHelper) CreateChannel(team *model.Team) *model.Channel

func (*TestHelper) CreatePost

func (me *TestHelper) CreatePost(channel *model.Channel) *model.Post

func (*TestHelper) CreatePrivateChannel

func (me *TestHelper) CreatePrivateChannel(team *model.Team) *model.Channel

func (*TestHelper) CreateTeam

func (me *TestHelper) CreateTeam() *model.Team

func (*TestHelper) CreateUser

func (me *TestHelper) CreateUser() *model.User

func (*TestHelper) InitBasic

func (me *TestHelper) InitBasic() *TestHelper

func (*TestHelper) InstallPlugin

func (me *TestHelper) InstallPlugin(manifest *model.Manifest, hooks plugin.Hooks)

func (*TestHelper) LinkUserToTeam

func (me *TestHelper) LinkUserToTeam(user *model.User, team *model.Team)

func (*TestHelper) MakeEmail

func (me *TestHelper) MakeEmail() string

func (*TestHelper) MakeUsername

func (me *TestHelper) MakeUsername() string

func (*TestHelper) TearDown

func (me *TestHelper) TearDown()

type UserChannelImportData

type UserChannelImportData struct {
	Name        *string                           `json:"name"`
	Roles       *string                           `json:"roles"`
	NotifyProps *UserChannelNotifyPropsImportData `json:"notify_props"`
	Favorite    *bool                             `json:"favorite"`
}

type UserChannelNotifyPropsImportData

type UserChannelNotifyPropsImportData struct {
	Desktop    *string `json:"desktop"`
	Mobile     *string `json:"mobile"`
	MarkUnread *string `json:"mark_unread"`
}

type UserImportData

type UserImportData struct {
	Username    *string `json:"username"`
	Email       *string `json:"email"`
	AuthService *string `json:"auth_service"`
	AuthData    *string `json:"auth_data"`
	Password    *string `json:"password"`
	Nickname    *string `json:"nickname"`
	FirstName   *string `json:"first_name"`
	LastName    *string `json:"last_name"`
	Position    *string `json:"position"`
	Roles       *string `json:"roles"`
	Locale      *string `json:"locale"`

	Teams *[]UserTeamImportData `json:"teams"`

	Theme              *string `json:"theme"`
	UseMilitaryTime    *string `json:"military_time"`
	CollapsePreviews   *string `json:"link_previews"`
	MessageDisplay     *string `json:"message_display"`
	ChannelDisplayMode *string `json:"channel_display_mode"`
	TutorialStep       *string `json:"tutorial_step"`

	NotifyProps *UserNotifyPropsImportData `json:"notify_props"`
}

type UserNotifyPropsImportData

type UserNotifyPropsImportData struct {
	Desktop         *string `json:"desktop"`
	DesktopDuration *string `json:"desktop_duration"`
	DesktopSound    *string `json:"desktop_sound"`

	Email *string `json:"email"`

	Mobile           *string `json:"mobile"`
	MobilePushStatus *string `json:"mobile_push_status"`

	ChannelTrigger  *string `json:"channel"`
	CommentsTrigger *string `json:"comments"`
	MentionKeys     *string `json:"mention_keys"`
}

type UserTeamImportData

type UserTeamImportData struct {
	Name     *string                  `json:"name"`
	Roles    *string                  `json:"roles"`
	Channels *[]UserChannelImportData `json:"channels"`
}

type VaryBy

type VaryBy struct{}

func (*VaryBy) Key

func (m *VaryBy) Key(r *http.Request) string

type WebConn

type WebConn struct {
	App       *App
	WebSocket *websocket.Conn
	Send      chan model.WebSocketMessage

	UserId                    string
	T                         goi18n.TranslateFunc
	Locale                    string
	AllChannelMembers         map[string]string
	LastAllChannelMembersTime int64
	Sequence                  int64
	// contains filtered or unexported fields
}

func (*WebConn) Close

func (wc *WebConn) Close()

func (*WebConn) GetSession

func (c *WebConn) GetSession() *model.Session

func (*WebConn) GetSessionExpiresAt

func (c *WebConn) GetSessionExpiresAt() int64

func (*WebConn) GetSessionToken

func (c *WebConn) GetSessionToken() string

func (*WebConn) InvalidateCache

func (webCon *WebConn) InvalidateCache()

func (*WebConn) IsAuthenticated

func (webCon *WebConn) IsAuthenticated() bool

func (*WebConn) IsMemberOfTeam

func (webCon *WebConn) IsMemberOfTeam(teamId string) bool

func (*WebConn) Pump

func (c *WebConn) Pump()

func (*WebConn) SendHello

func (webCon *WebConn) SendHello()

func (*WebConn) SetSession

func (c *WebConn) SetSession(v *model.Session)

func (*WebConn) SetSessionExpiresAt

func (c *WebConn) SetSessionExpiresAt(v int64)

func (*WebConn) SetSessionToken

func (c *WebConn) SetSessionToken(v string)

func (*WebConn) ShouldSendEvent

func (webCon *WebConn) ShouldSendEvent(msg *model.WebSocketEvent) bool

type WebSocketRouter

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

func (*WebSocketRouter) Handle

func (wr *WebSocketRouter) Handle(action string, handler webSocketHandler)

func (*WebSocketRouter) ServeWebSocket

func (wr *WebSocketRouter) ServeWebSocket(conn *WebConn, r *model.WebSocketRequest)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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