platform: github.com/rodrigocorsi2/platform/app Index | Files

package app

import "github.com/rodrigocorsi2/platform/app"

Index

Package Files

admin.go analytics.go app.go apptestlib.go audit.go authentication.go authorization.go auto_channels.go auto_constants.go auto_environment.go auto_posts.go auto_teams.go auto_users.go brand.go channel.go command.go command_away.go command_echo.go command_expand_collapse.go command_invite_people.go command_join.go command_loadtest.go command_logout.go command_me.go command_msg.go command_offline.go command_online.go command_shortcuts.go command_shrug.go compliance.go diagnostics.go email.go email_batching.go file.go import.go ldap.go license.go login.go notification.go oauth.go post.go preference.go saml.go security_update_check.go server.go session.go slackimport.go status.go team.go user.go web_conn.go web_hub.go webhook.go websocket_router.go webtrc.go

Constants

const (
    DAY_MILLISECONDS   = 24 * 60 * 60 * 1000
    MONTH_MILLISECONDS = 31 * DAY_MILLISECONDS
)
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"
)
const (
    CMD_EXPAND   = "expand"
    CMD_COLLAPSE = "collapse"
)
const (
    SEGMENT_KEY = "fwb7VPbFeQ7SKp3wHm1RzFUuXZudqVok"

    TRACK_CONFIG_SERVICE      = "config_service"
    TRACK_CONFIG_TEAM         = "config_team"
    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_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_ACTIVITY = "activity"
    TRACK_LICENSE  = "license"
    TRACK_SERVER   = "server"
)
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
)
const (
    SECURITY_URL           = "https://d7zmvsa9e04kk.cloudfront.net"
    SECURITY_UPDATE_PERIOD = 86400000 // 24 hours in milliseconds.

    PROP_SECURITY_ID                = "id"
    PROP_SECURITY_CATEGORY          = "c"
    VAL_SECURITY_CATEGORY_DEFAULT   = "d"
    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"
)
const (
    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
)
const (
    TRIGGERWORDS_FULL       = 0
    TRIGGERWORDS_STARTSWITH = 1
)
const (
    CMD_AWAY = "away"
)
const (
    CMD_ECHO = "echo"
)
const (
    CMD_INVITE_PEOPLE = "invite_people"
)
const (
    CMD_JOIN = "join"
)
const (
    CMD_LOADTEST = "loadtest"
)
const (
    CMD_LOGOUT = "logout"
)
const (
    CMD_ME = "me"
)
const (
    CMD_MSG = "msg"
)
const (
    CMD_OFFLINE = "offline"
)
const (
    CMD_ONLINE = "online"
)
const (
    CMD_SHORTCUTS = "shortcuts"
)
const (
    CMD_SHRUG = "shrug"
)
const (
    EMAIL_BATCHING_TASK_NAME = "Email Batching"
)
const TIME_TO_WAIT_FOR_CONNECTIONS_TO_CLOSE_ON_SERVER_SHUTDOWN = time.Second

Variables

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

func ActivateMfa Uses

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

func AddDirectChannels Uses

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

func AddNotificationEmailToBatch Uses

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

func AddSamlIdpCertificate Uses

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

func AddSamlPrivateCertificate Uses

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

func AddSamlPublicCertificate Uses

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

func AddSessionToCache Uses

func AddSessionToCache(session *model.Session)

func AddStatusCache Uses

func AddStatusCache(status *model.Status)

func AddStatusCacheSkipClusterSend Uses

func AddStatusCacheSkipClusterSend(status *model.Status)

func AddUserToChannel Uses

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

func AddUserToTeam Uses

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

func AddUserToTeamByHash Uses

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

func AddUserToTeamByInviteId Uses

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

func AddUserToTeamByTeamId Uses

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

func AttachDeviceId Uses

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

func AuthenticateUserForLogin Uses

func AuthenticateUserForLogin(id, loginId, password, mfaToken, deviceId string, ldapOnly bool) (*model.User, *model.AppError)

func AutocompleteUsersInChannel Uses

func AutocompleteUsersInChannel(teamId string, channelId string, term string, searchOptions map[string]bool, asAdmin bool) (*model.UserAutocompleteInChannel, *model.AppError)

func AutocompleteUsersInTeam Uses

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

func BulkImport Uses

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

func CheckIfRolesGrantPermission Uses

func CheckIfRolesGrantPermission(roles []string, permissionId string) bool

func CheckPasswordAndAllCriteria Uses

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

func CheckUserAdditionalAuthenticationCriteria Uses

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

func CheckUserDomain Uses

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 CheckUserMfa Uses

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

func ClearPushNotification Uses

func ClearPushNotification(userId string, channelId string) *model.AppError

func ClearSessionCacheForUser Uses

func ClearSessionCacheForUser(userId string)

func ClearSessionCacheForUserSkipClusterSend Uses

func ClearSessionCacheForUserSkipClusterSend(userId string)

func ClearStatusCache Uses

func ClearStatusCache()

func CloseBody Uses

func CloseBody(r *http.Response)

func CreateBasicUser Uses

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

Basic test team and user so you always know one

func CreateChannel Uses

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

func CreateChannelWithUser Uses

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

func CreateCommand Uses

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

func CreateCommandPost Uses

func CreateCommandPost(post *model.Post, teamId string, response *model.CommandResponse) (*model.Post, *model.AppError)

func CreateDefaultChannels Uses

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

func CreateDirectChannel Uses

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

func CreateGroupChannel Uses

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

func CreateIncomingWebhookForChannel Uses

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

func CreateOAuthUser Uses

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

func CreateOutgoingWebhook Uses

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

func CreatePasswordRecovery Uses

func CreatePasswordRecovery(userId string) (*model.PasswordRecovery, *model.AppError)

func CreatePost Uses

func CreatePost(post *model.Post, teamId string, triggerWebhooks bool) (*model.Post, *model.AppError)

func CreatePostAsUser Uses

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

func CreateProfileImage Uses

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

func CreateSession Uses

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

func CreateTeam Uses

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

func CreateTeamWithUser Uses

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

func CreateUser Uses

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

func CreateUserFromSignup Uses

func CreateUserFromSignup(user *model.User, siteURL string) (*model.User, *model.AppError)

func CreateUserWithHash Uses

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

func CreateUserWithInviteId Uses

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

func CreateWebhookPost Uses

func CreateWebhookPost(userId, teamId, channelId, text, overrideUsername, overrideIconUrl string, props model.StringInterface, postType string) (*model.Post, *model.AppError)

func DeactivateMfa Uses

func DeactivateMfa(userId string) *model.AppError

func DeleteChannel Uses

func DeleteChannel(channel *model.Channel, userId string) *model.AppError

func DeleteCommand Uses

func DeleteCommand(commandId string) *model.AppError

func DeleteFlaggedPosts Uses

func DeleteFlaggedPosts(postId string)

func DeleteIncomingWebhook Uses

func DeleteIncomingWebhook(hookId string) *model.AppError

func DeleteOutgoingWebhook Uses

func DeleteOutgoingWebhook(hookId string) *model.AppError

func DeletePasswordRecoveryForUser Uses

func DeletePasswordRecoveryForUser(userId string) *model.AppError

func DeletePost Uses

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

func DeletePostFiles Uses

func DeletePostFiles(post *model.Post)

func DeletePreferences Uses

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

func DoLogin Uses

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

func DoSecurityUpdateCheck Uses

func DoSecurityUpdateCheck()

func DoUploadFile Uses

func DoUploadFile(teamId string, channelId string, userId string, rawFilename string, data []byte) (*model.FileInfo, *model.AppError)

func DoesNotifyPropsAllowPushNotification Uses

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

func DoesStatusAllowPushNotification Uses

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

func ExecuteCommand Uses

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

func FindTeamByName Uses

func FindTeamByName(name string) bool

func FindTeamIdForFilename Uses

func FindTeamIdForFilename(post *model.Post, filename string) string
func GeneratePublicLink(siteURL string, info *model.FileInfo) string

func GeneratePublicLinkHash Uses

func GeneratePublicLinkHash(fileId, salt string) string

func GeneratePublicLinkV3 Uses

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

func GetAllOpenTeams Uses

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

func GetAllOpenTeamsPage Uses

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

func GetAllStatuses Uses

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

func GetAllTeams Uses

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

func GetAllTeamsPage Uses

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

func GetAnalytics Uses

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

func GetAudits Uses

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

func GetAuditsPage Uses

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

func GetBrandImage Uses

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

func GetChannel Uses

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

func GetChannelByName Uses

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

func GetChannelByNameForTeamName Uses

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

func GetChannelCounts Uses

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

func GetChannelMember Uses

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

func GetChannelMemberCount Uses

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

func GetChannelMembersByIds Uses

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

func GetChannelMembersForUser Uses

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

func GetChannelMembersPage Uses

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

func GetChannelsForUser Uses

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

func GetChannelsUserNotIn Uses

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

func GetClusterStatus Uses

func GetClusterStatus() []*model.ClusterInfo

func GetCommand Uses

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

func GetComplianceFile Uses

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

func GetComplianceReport Uses

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

func GetComplianceReports Uses

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

func GetConfig Uses

func GetConfig() *model.Config

func GetExplicitMentions Uses

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 GetFileInfo Uses

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

func GetFileInfosForPost Uses

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

func GetFlaggedPosts Uses

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

func GetIncomingWebhook Uses

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

func GetIncomingWebhooksForTeamPage Uses

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

func GetIncomingWebhooksPage Uses

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

func GetInfoForFilename Uses

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

func GetLogs Uses

func GetLogs() ([]string, *model.AppError)

func GetLogsSkipSend Uses

func GetLogsSkipSend() ([]string, *model.AppError)

func GetMentionKeywordsInChannel Uses

func GetMentionKeywordsInChannel(profiles map[string]*model.User) map[string][]string

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

func GetMessageForNotification Uses

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

func GetNumberOfChannelsOnTeam Uses

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

func GetOpenGraphMetadata Uses

func GetOpenGraphMetadata(url string) *opengraph.OpenGraph

func GetOutgoingWebhook Uses

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

func GetOutgoingWebhooksForChannelPage Uses

func GetOutgoingWebhooksForChannelPage(channelId string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError)

func GetOutgoingWebhooksForTeamPage Uses

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

func GetOutgoingWebhooksPage Uses

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

func GetPasswordRecovery Uses

func GetPasswordRecovery(code string) (*model.PasswordRecovery, *model.AppError)

func GetPermalinkPost Uses

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

func GetPostThread Uses

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

func GetPosts Uses

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

func GetPostsAroundPost Uses

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

func GetPostsEtag Uses

func GetPostsEtag(channelId string) string

func GetPostsPage Uses

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

func GetPostsSince Uses

func GetPostsSince(channelId string, time int64) (*model.PostList, *model.AppError)

func GetPreferenceByCategoryAndNameForUser Uses

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

func GetPreferenceByCategoryForUser Uses

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

func GetPreferencesForUser Uses

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

func GetProfileImage Uses

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

func GetProtocol Uses

func GetProtocol(r *http.Request) string

func GetPublicChannelsForTeam Uses

func GetPublicChannelsForTeam(teamId string, offset int, limit int) (*model.ChannelList, *model.AppError)

func GetRecentlyActiveUsersForTeam Uses

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

func GetSamlCertificateStatus Uses

func GetSamlCertificateStatus() *model.SamlCertificateStatus

func GetSamlMetadata Uses

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

func GetSession Uses

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

func GetSessions Uses

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

func GetSinglePost Uses

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

func GetStatus Uses

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

func GetStatusFromCache Uses

func GetStatusFromCache(userId string) *model.Status

func GetStatusesByIds Uses

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

func GetTeam Uses

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

func GetTeamByInviteId Uses

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

func GetTeamByName Uses

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

func GetTeamMember Uses

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

func GetTeamMembers Uses

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

func GetTeamMembersByIds Uses

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

func GetTeamMembersForUser Uses

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

func GetTeamStats Uses

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

func GetTeamUnread Uses

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

func GetTeamsForUser Uses

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

func GetTeamsUnreadForUser Uses

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

func GetUser Uses

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

func GetUserByAuth Uses

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

func GetUserByEmail Uses

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

func GetUserByUsername Uses

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

func GetUserForLogin Uses

func GetUserForLogin(loginId string, onlyLdap bool) (*model.User, *model.AppError)

func GetUsers Uses

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

func GetUsersByIds Uses

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

func GetUsersEtag Uses

func GetUsersEtag() string

func GetUsersInChannel Uses

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

func GetUsersInChannelMap Uses

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

func GetUsersInChannelPage Uses

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

func GetUsersInTeam Uses

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

func GetUsersInTeamEtag Uses

func GetUsersInTeamEtag(teamId string) string

func GetUsersInTeamMap Uses

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

func GetUsersInTeamPage Uses

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

func GetUsersMap Uses

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

func GetUsersNotInChannel Uses

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

func GetUsersNotInChannelMap Uses

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

func GetUsersNotInChannelPage Uses

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

func GetUsersPage Uses

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

func HandleCommandResponse Uses

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

func HandleImages Uses

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

func HandleIncomingWebhook Uses

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

func HasPermissionTo Uses

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

func HasPermissionToChannel Uses

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

func HasPermissionToChannelByPost Uses

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

func HasPermissionToTeam Uses

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

func HasPermissionToUser Uses

func HasPermissionToUser(askingUserId string, userId string) bool

func HubRegister Uses

func HubRegister(webConn *WebConn)

func HubStart Uses

func HubStart()

func HubStop Uses

func HubStop()

func HubUnregister Uses

func HubUnregister(webConn *WebConn)

func ImportChannel Uses

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

func ImportLine Uses

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

func ImportPost Uses

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

func ImportTeam Uses

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

func ImportUser Uses

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

func ImportUserChannels Uses

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

func ImportUserTeams Uses

func ImportUserTeams(username string, data *[]UserTeamImportData) *model.AppError

func InitEmailBatching Uses

func InitEmailBatching()

func InitStores Uses

func InitStores()

func InvalidateAllCaches Uses

func InvalidateAllCaches() *model.AppError

func InvalidateAllCachesSkipSend Uses

func InvalidateAllCachesSkipSend()

func InvalidateCacheForChannel Uses

func InvalidateCacheForChannel(channel *model.Channel)

func InvalidateCacheForChannelByNameSkipClusterSend Uses

func InvalidateCacheForChannelByNameSkipClusterSend(teamId, name string)

func InvalidateCacheForChannelMembers Uses

func InvalidateCacheForChannelMembers(channelId string)

func InvalidateCacheForChannelMembersNotifyProps Uses

func InvalidateCacheForChannelMembersNotifyProps(channelId string)

func InvalidateCacheForChannelMembersNotifyPropsSkipClusterSend Uses

func InvalidateCacheForChannelMembersNotifyPropsSkipClusterSend(channelId string)

func InvalidateCacheForChannelMembersSkipClusterSend Uses

func InvalidateCacheForChannelMembersSkipClusterSend(channelId string)

func InvalidateCacheForChannelPosts Uses

func InvalidateCacheForChannelPosts(channelId string)

func InvalidateCacheForChannelPostsSkipClusterSend Uses

func InvalidateCacheForChannelPostsSkipClusterSend(channelId string)

func InvalidateCacheForChannelSkipClusterSend Uses

func InvalidateCacheForChannelSkipClusterSend(channelId string)

func InvalidateCacheForReactions Uses

func InvalidateCacheForReactions(postId string)

func InvalidateCacheForReactionsSkipClusterSend Uses

func InvalidateCacheForReactionsSkipClusterSend(postId string)

func InvalidateCacheForUser Uses

func InvalidateCacheForUser(userId string)

func InvalidateCacheForUserSkipClusterSend Uses

func InvalidateCacheForUserSkipClusterSend(userId string)

func InvalidateCacheForWebhook Uses

func InvalidateCacheForWebhook(webhookId string)

func InvalidateCacheForWebhookSkipClusterSend Uses

func InvalidateCacheForWebhookSkipClusterSend(webhookId string)

func InvalidateWebConnSessionCacheForUser Uses

func InvalidateWebConnSessionCacheForUser(userId string)

func InviteNewUsersToTeam Uses

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

func IsFirstUserAccount Uses

func IsFirstUserAccount() bool

func IsUserAway Uses

func IsUserAway(lastActivityAt int64) bool

func IsUserSignUpAllowed Uses

func IsUserSignUpAllowed() *model.AppError

func IsUsernameTaken Uses

func IsUsernameTaken(name string) bool

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

func JoinChannel Uses

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

func JoinDefaultChannels Uses

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

func JoinUserToTeam Uses

func JoinUserToTeam(team *model.Team, user *model.User) *model.AppError

func LeaveChannel Uses

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

func LeaveTeam Uses

func LeaveTeam(team *model.Team, user *model.User) *model.AppError

func LinkUserToTeam Uses

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

func ListCommands Uses

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

func ListTeamCommands Uses

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

func LoadLicense Uses

func LoadLicense()

func MigrateFilenamesToFileInfos Uses

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

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

func MoveFile Uses

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

func NewServer Uses

func NewServer()

func OldImportChannel Uses

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

func OldImportFile Uses

func OldImportFile(file io.Reader, teamId string, channelId string, userId string, fileName string) (*model.FileInfo, error)

func OldImportIncomingWebhookPost Uses

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

func OldImportPost Uses

func OldImportPost(post *model.Post)

func OldImportUser Uses

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

func PatchUser Uses

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

func PermanentDeleteAllUsers Uses

func PermanentDeleteAllUsers() *model.AppError

func PermanentDeleteChannel Uses

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

func PermanentDeleteTeam Uses

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

func PermanentDeleteUser Uses

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

func PostAddToChannelMessage Uses

func PostAddToChannelMessage(user *model.User, addedUser *model.User, channel *model.Channel) *model.AppError

func PostRemoveFromChannelMessage Uses

func PostRemoveFromChannelMessage(removerUserId string, removedUser *model.User, channel *model.Channel) *model.AppError

func PostUpdateChannelDisplayNameMessage Uses

func PostUpdateChannelDisplayNameMessage(userId string, channelId string, teamId string, oldChannelDisplayName, newChannelDisplayName string) *model.AppError

func PostUpdateChannelHeaderMessage Uses

func PostUpdateChannelHeaderMessage(userId string, channelId string, teamId string, oldChannelHeader, newChannelHeader string) *model.AppError

func PostUpdateChannelPurposeMessage Uses

func PostUpdateChannelPurposeMessage(userId string, channelId string, teamId string, oldChannelPurpose string, newChannelPurpose string) *model.AppError

func Publish Uses

func Publish(message *model.WebSocketEvent)

func PublishSkipClusterSend Uses

func PublishSkipClusterSend(message *model.WebSocketEvent)

func ReadFile Uses

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

func RecycleDatabaseConnection Uses

func RecycleDatabaseConnection()

func RegenCommandToken Uses

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

func RegenOutgoingWebhookToken Uses

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

func RegisterCommandProvider Uses

func RegisterCommandProvider(newProvider CommandProvider)

func ReloadConfig Uses

func ReloadConfig()

func RemoveLicense Uses

func RemoveLicense() *model.AppError

func RemoveSamlFile Uses

func RemoveSamlFile(filename string) *model.AppError

func RemoveSamlIdpCertificate Uses

func RemoveSamlIdpCertificate() *model.AppError

func RemoveSamlPrivateCertificate Uses

func RemoveSamlPrivateCertificate() *model.AppError

func RemoveSamlPublicCertificate Uses

func RemoveSamlPublicCertificate() *model.AppError

func RemoveUserFromChannel Uses

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

func RemoveUserFromTeam Uses

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

func ResetPasswordFromCode Uses

func ResetPasswordFromCode(code, newPassword, siteURL string) *model.AppError

func ReturnWebSocketError Uses

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

func RevokeAccessToken Uses

func RevokeAccessToken(token string) *model.AppError

func RevokeAllSessions Uses

func RevokeAllSessions(userId string) *model.AppError

func RevokeSession Uses

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

func RevokeSessionById Uses

func RevokeSessionById(sessionId string) *model.AppError

func RevokeSessionsForDeviceId Uses

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

func RevokeWebrtcToken Uses

func RevokeWebrtcToken(sessionId string)

func SanitizeProfile Uses

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

func SaveBrandImage Uses

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

func SaveComplianceReport Uses

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

func SaveConfig Uses

func SaveConfig(cfg *model.Config) *model.AppError

func SaveLicense Uses

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

func SearchChannels Uses

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

func SearchChannelsUserNotIn Uses

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

func SearchPostsInTeam Uses

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

func SearchUsersInChannel Uses

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

func SearchUsersInTeam Uses

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

func SearchUsersNotInChannel Uses

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

func SendChangeUsernameEmail Uses

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

func SendDailyDiagnostics Uses

func SendDailyDiagnostics()

func SendDiagnostic Uses

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

func SendEmailChangeEmail Uses

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

func SendEmailChangeVerifyEmail Uses

func SendEmailChangeVerifyEmail(userId, newUserEmail, locale, siteURL string) *model.AppError

func SendEphemeralPost Uses

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

func SendInviteEmails Uses

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

func SendMfaChangeEmail Uses

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

func SendNotifications Uses

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

func SendPasswordChangeEmail Uses

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

func SendPasswordReset Uses

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

func SendPasswordResetEmail Uses

func SendPasswordResetEmail(email string, recovery *model.PasswordRecovery, locale, siteURL string) (bool, *model.AppError)

func SendSignInChangeEmail Uses

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

func SendVerifyEmail Uses

func SendVerifyEmail(userId, userEmail, locale, siteURL string) *model.AppError

func SendWelcomeEmail Uses

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

func SessionCacheLength Uses

func SessionCacheLength() int

func SessionHasPermissionTo Uses

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

func SessionHasPermissionToChannel Uses

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

func SessionHasPermissionToChannelByPost Uses

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

func SessionHasPermissionToPost Uses

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

func SessionHasPermissionToTeam Uses

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

func SessionHasPermissionToUser Uses

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

func SetActiveChannel Uses

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

func SetProfileImage Uses

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

func SetStatusAwayIfNeeded Uses

func SetStatusAwayIfNeeded(userId string, manual bool)

func SetStatusOffline Uses

func SetStatusOffline(userId string, manual bool)

func SetStatusOnline Uses

func SetStatusOnline(userId string, sessionId string, manual bool)

func ShouldSendPushNotification Uses

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

func SlackAddBotUser Uses

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

func SlackAddChannels Uses

func 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 SlackAddPosts Uses

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

func SlackAddUsers Uses

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

func SlackConvertChannelMentions Uses

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

func SlackConvertChannelName Uses

func SlackConvertChannelName(channelName string) string

func SlackConvertPostsMarkup Uses

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

func SlackConvertTimeStamp Uses

func SlackConvertTimeStamp(ts string) int64

func SlackConvertUserMentions Uses

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

func SlackImport Uses

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

func SlackSanitiseChannelProperties Uses

func SlackSanitiseChannelProperties(channel model.Channel) model.Channel

func SlackUploadFile Uses

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

func StartServer Uses

func StartServer()

func StopServer Uses

func StopServer()

func SyncLdap Uses

func SyncLdap()

func TearDown Uses

func TearDown()

func TestEmail Uses

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

func TestLdap Uses

func TestLdap() *model.AppError

func TotalWebsocketConnections Uses

func TotalWebsocketConnections() int

func UpdateActive Uses

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

func UpdateActiveNoLdap Uses

func UpdateActiveNoLdap(userId string, active bool) (*model.User, *model.AppError)

func UpdateChannel Uses

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

func UpdateChannelLastViewedAt Uses

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

func UpdateChannelMemberNotifyProps Uses

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

func UpdateChannelMemberRoles Uses

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

func UpdateCommand Uses

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

func UpdateIncomingWebhook Uses

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

func UpdateMfa Uses

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

func UpdateOAuthUserAttrs Uses

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

func UpdateOutgoingWebhook Uses

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

func UpdatePassword Uses

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

func UpdatePasswordAsUser Uses

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

func UpdatePasswordByUserIdSendEmail Uses

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

func UpdatePasswordSendEmail Uses

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

func UpdatePost Uses

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

func UpdatePreferences Uses

func UpdatePreferences(preferences model.Preferences) (bool, *model.AppError)

func UpdateTeam Uses

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

func UpdateTeamMemberRoles Uses

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

func UpdateUser Uses

func UpdateUser(user *model.User, siteURL string, sendNotifications bool) (*model.User, *model.AppError)

func UpdateUserAsUser Uses

func UpdateUserAsUser(user *model.User, siteURL string, asAdmin bool) (*model.User, *model.AppError)

func UpdateUserNotifyProps Uses

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

func UpdateUserRoles Uses

func UpdateUserRoles(userId string, newRoles string) (*model.User, *model.AppError)

func UploadFiles Uses

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

func VerifyUserEmail Uses

func VerifyUserEmail(userId string) *model.AppError

func ViewChannel Uses

func ViewChannel(view *model.ChannelView, userId string, clearPushNotifications bool) *model.AppError

func WaitForChannelMembership Uses

func WaitForChannelMembership(channelId string, userId string)

func WriteFile Uses

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

func WriteSamlFile Uses

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

type AutoChannelCreator Uses

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

func NewAutoChannelCreator Uses

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

func (*AutoChannelCreator) CreateTestChannels Uses

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

type AutoPostCreator Uses

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 Uses

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

Automatic poster used for testing

func (*AutoPostCreator) CreateRandomPost Uses

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

func (*AutoPostCreator) CreateTestPosts Uses

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

func (*AutoPostCreator) UploadTestFile Uses

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

type AutoTeamCreator Uses

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 Uses

func NewAutoTeamCreator(client *model.Client) *AutoTeamCreator

func (*AutoTeamCreator) CreateTestTeams Uses

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

type AutoUserCreator Uses

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

func NewAutoUserCreator Uses

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

func (*AutoUserCreator) CreateTestUsers Uses

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

type AwayProvider Uses

type AwayProvider struct {
}

func (*AwayProvider) DoCommand Uses

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

func (*AwayProvider) GetCommand Uses

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

func (*AwayProvider) GetTrigger Uses

func (me *AwayProvider) GetTrigger() string

type ChannelImportData Uses

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 CollapseProvider Uses

type CollapseProvider struct {
}

func (*CollapseProvider) DoCommand Uses

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

func (*CollapseProvider) GetCommand Uses

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

func (*CollapseProvider) GetTrigger Uses

func (me *CollapseProvider) GetTrigger() string

type CommandProvider Uses

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

func GetCommandProvider Uses

func GetCommandProvider(name string) CommandProvider

type CorsWrapper Uses

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

func (*CorsWrapper) ServeHTTP Uses

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

type EchoProvider Uses

type EchoProvider struct {
}

func (*EchoProvider) DoCommand Uses

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

func (*EchoProvider) GetCommand Uses

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

func (*EchoProvider) GetTrigger Uses

func (me *EchoProvider) GetTrigger() string

type EmailBatchingJob Uses

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

func MakeEmailBatchingJob Uses

func MakeEmailBatchingJob(bufferSize int) *EmailBatchingJob

func (*EmailBatchingJob) Add Uses

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

func (*EmailBatchingJob) CheckPendingEmails Uses

func (job *EmailBatchingJob) CheckPendingEmails()

func (*EmailBatchingJob) Start Uses

func (job *EmailBatchingJob) Start()

type ExpandProvider Uses

type ExpandProvider struct {
}

func (*ExpandProvider) DoCommand Uses

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

func (*ExpandProvider) GetCommand Uses

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

func (*ExpandProvider) GetTrigger Uses

func (me *ExpandProvider) GetTrigger() string

type Hub Uses

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

func GetHubForUserId Uses

func GetHubForUserId(userId string) *Hub

func NewWebHub Uses

func NewWebHub() *Hub

func (*Hub) Broadcast Uses

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

func (*Hub) InvalidateUser Uses

func (h *Hub) InvalidateUser(userId string)

func (*Hub) Register Uses

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

func (*Hub) Start Uses

func (h *Hub) Start()

func (*Hub) Stop Uses

func (h *Hub) Stop()

func (*Hub) Unregister Uses

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

type InvitePeopleProvider Uses

type InvitePeopleProvider struct {
}

func (*InvitePeopleProvider) DoCommand Uses

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

func (*InvitePeopleProvider) GetCommand Uses

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

func (*InvitePeopleProvider) GetTrigger Uses

func (me *InvitePeopleProvider) GetTrigger() string

type JoinProvider Uses

type JoinProvider struct {
}

func (*JoinProvider) DoCommand Uses

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

func (*JoinProvider) GetCommand Uses

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

func (*JoinProvider) GetTrigger Uses

func (me *JoinProvider) GetTrigger() string

type LineImportData Uses

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

type LoadTestProvider Uses

type LoadTestProvider struct {
}

func (*LoadTestProvider) ChannelsCommand Uses

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

func (*LoadTestProvider) DoCommand Uses

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

func (*LoadTestProvider) GetCommand Uses

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

func (*LoadTestProvider) GetTrigger Uses

func (me *LoadTestProvider) GetTrigger() string

func (*LoadTestProvider) HelpCommand Uses

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

func (*LoadTestProvider) JsonCommand Uses

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

func (*LoadTestProvider) PostsCommand Uses

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

func (*LoadTestProvider) SetupCommand Uses

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

func (*LoadTestProvider) UrlCommand Uses

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

func (*LoadTestProvider) UsersCommand Uses

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

type LogoutProvider Uses

type LogoutProvider struct {
}

func (*LogoutProvider) DoCommand Uses

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

func (*LogoutProvider) GetCommand Uses

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

func (*LogoutProvider) GetTrigger Uses

func (me *LogoutProvider) GetTrigger() string

type MeProvider Uses

type MeProvider struct {
}

func (*MeProvider) DoCommand Uses

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

func (*MeProvider) GetCommand Uses

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

func (*MeProvider) GetTrigger Uses

func (me *MeProvider) GetTrigger() string

type OfflineProvider Uses

type OfflineProvider struct {
}

func (*OfflineProvider) DoCommand Uses

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

func (*OfflineProvider) GetCommand Uses

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

func (*OfflineProvider) GetTrigger Uses

func (me *OfflineProvider) GetTrigger() string

type OnlineProvider Uses

type OnlineProvider struct {
}

func (*OnlineProvider) DoCommand Uses

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

func (*OnlineProvider) GetCommand Uses

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

func (*OnlineProvider) GetTrigger Uses

func (me *OnlineProvider) GetTrigger() string

type PostImportData Uses

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

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

type Server Uses

type Server struct {
    Store           store.Store
    WebSocketRouter *WebSocketRouter
    Router          *mux.Router
    GracefulServer  *graceful.Server
}
var Srv *Server

type ShortcutsProvider Uses

type ShortcutsProvider struct {
}

func (*ShortcutsProvider) DoCommand Uses

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

func (*ShortcutsProvider) GetCommand Uses

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

func (*ShortcutsProvider) GetTrigger Uses

func (me *ShortcutsProvider) GetTrigger() string

type ShrugProvider Uses

type ShrugProvider struct {
}

func (*ShrugProvider) DoCommand Uses

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

func (*ShrugProvider) GetCommand Uses

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

func (*ShrugProvider) GetTrigger Uses

func (me *ShrugProvider) GetTrigger() string

type SlackAttachment Uses

type SlackAttachment struct {
    Id      int                      `json:"id"`
    Text    string                   `json:"text"`
    Pretext string                   `json:"pretext"`
    Fields  []map[string]interface{} `json:"fields"`
}

type SlackChannel Uses

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 Uses

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

type SlackComment Uses

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

type SlackFile Uses

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

type SlackPost Uses

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 []SlackAttachment `json:"attachments"`
}

func SlackParsePosts Uses

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

type SlackUser Uses

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

func SlackParseUsers Uses

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

type TeamEnvironment Uses

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

func CreateTestEnvironmentInTeam Uses

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

type TeamImportData Uses

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 Uses

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

func CreateTestEnvironmentWithTeams Uses

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

type TestHelper Uses

type TestHelper struct {
    BasicTeam    *model.Team
    BasicUser    *model.User
    BasicUser2   *model.User
    BasicChannel *model.Channel
    BasicPost    *model.Post
}

func Setup Uses

func Setup() *TestHelper

func SetupEnterprise Uses

func SetupEnterprise() *TestHelper

func (*TestHelper) CreateChannel Uses

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

func (*TestHelper) CreatePost Uses

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

func (*TestHelper) CreatePrivateChannel Uses

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

func (*TestHelper) CreateTeam Uses

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

func (*TestHelper) CreateUser Uses

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

func (*TestHelper) InitBasic Uses

func (me *TestHelper) InitBasic() *TestHelper

type UserChannelImportData Uses

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

type UserChannelNotifyPropsImportData Uses

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

type UserImportData Uses

type UserImportData struct {
    Username    *string `json:"username"`
    Email       *string `json:"email"`
    AuthService *string `json:"auth_service"`
    AuthData    *string `json:"auth_data"`
    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"`
    SelectedFont       *string `json:"display_font"`
    UseMilitaryTime    *string `json:"military_time"`
    NameFormat         *string `json:"teammate_name_display"`
    CollapsePreviews   *string `json:"link_previews"`
    MessageDisplay     *string `json:"message_display"`
    ChannelDisplayMode *string `json:"channel_display_mode"`
}

type UserTeamImportData Uses

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

type VaryBy Uses

type VaryBy struct{}

func (*VaryBy) Key Uses

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

type WebConn Uses

type WebConn struct {
    WebSocket                 *websocket.Conn
    Send                      chan model.WebSocketMessage
    SessionToken              string
    SessionExpiresAt          int64
    Session                   *model.Session
    UserId                    string
    T                         goi18n.TranslateFunc
    Locale                    string
    AllChannelMembers         map[string]string
    LastAllChannelMembersTime int64
}

func NewWebConn Uses

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

func (*WebConn) InvalidateCache Uses

func (webCon *WebConn) InvalidateCache()

func (*WebConn) IsAuthenticated Uses

func (webCon *WebConn) IsAuthenticated() bool

func (*WebConn) IsMemberOfTeam Uses

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

func (*WebConn) ReadPump Uses

func (c *WebConn) ReadPump()

func (*WebConn) SendHello Uses

func (webCon *WebConn) SendHello()

func (*WebConn) ShouldSendEvent Uses

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

func (*WebConn) WritePump Uses

func (c *WebConn) WritePump()

type WebSocketRouter Uses

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

func NewWebSocketRouter Uses

func NewWebSocketRouter() *WebSocketRouter

func (*WebSocketRouter) Handle Uses

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

func (*WebSocketRouter) ServeWebSocket Uses

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

Package app imports 58 packages (graph). Updated 2018-03-18. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).