Documentation ¶
Index ¶
- Constants
- Variables
- func ActivateMfa(userId, token string) *model.AppError
- func AddNotificationEmailToBatch(user *model.User, post *model.Post, team *model.Team) *model.AppError
- func AddSessionToCache(session *model.Session)
- func AddStatusCache(status *model.Status)
- func AddStatusCacheSkipClusterSend(status *model.Status)
- func AddUserToChannel(user *model.User, channel *model.Channel) (*model.ChannelMember, *model.AppError)
- func ApiAdminSystemRequired(h func(*Context, http.ResponseWriter, *http.Request)) http.Handler
- func ApiAdminSystemRequiredTrustRequester(h func(*Context, http.ResponseWriter, *http.Request)) http.Handler
- func ApiAppHandler(h func(*Context, http.ResponseWriter, *http.Request)) http.Handler
- func ApiAppHandlerTrustRequester(h func(*Context, http.ResponseWriter, *http.Request)) http.Handler
- func ApiAppHandlerTrustRequesterIndependent(h func(*Context, http.ResponseWriter, *http.Request)) http.Handler
- func ApiUserRequired(h func(*Context, http.ResponseWriter, *http.Request)) http.Handler
- func ApiUserRequiredActivity(h func(*Context, http.ResponseWriter, *http.Request), isUserActivity bool) http.Handler
- func ApiUserRequiredMfa(h func(*Context, http.ResponseWriter, *http.Request)) http.Handler
- func ApiUserRequiredTrustRequester(h func(*Context, http.ResponseWriter, *http.Request)) http.Handler
- func ApiWebSocketHandler(wh func(*model.WebSocketRequest) (map[string]interface{}, *model.AppError)) *webSocketHandler
- func AppHandler(h func(*Context, http.ResponseWriter, *http.Request)) http.Handler
- func AppHandlerIndependent(h func(*Context, http.ResponseWriter, *http.Request)) http.Handler
- func AppHandlerTrustRequester(h func(*Context, http.ResponseWriter, *http.Request)) http.Handler
- func AuthorizeOAuthUser(service, code, state, redirectUri string) (io.ReadCloser, string, map[string]string, *model.AppError)
- func CanManageChannel(c *Context, channel *model.Channel) bool
- func CheckIfRolesGrantPermission(roles []string, permissionId string) bool
- func CheckUserDomain(user *model.User, domains string) bool
- func ClearStatusCache()
- func CompleteSwitchWithOAuth(c *Context, w http.ResponseWriter, r *http.Request, service string, ...)
- func CreateBasicUser(client *model.Client) *model.AppError
- func CreateChannel(c *Context, channel *model.Channel, addMember bool) (*model.Channel, *model.AppError)
- func CreateCommandPost(c *Context, post *model.Post, response *model.CommandResponse)
- func CreateDefaultChannels(c *Context, teamId string) ([]*model.Channel, *model.AppError)
- func CreateDirectChannel(userId string, otherUserId string) (*model.Channel, *model.AppError)
- func CreateOAuthUser(c *Context, w http.ResponseWriter, r *http.Request, service string, ...) *model.User
- func CreatePost(c *Context, post *model.Post, triggerWebhooks bool) (*model.Post, *model.AppError)
- func CreateTeam(c *Context, team *model.Team) *model.Team
- func CreateUser(user *model.User) (*model.User, *model.AppError)
- func CreateWebhookPost(c *Context, channelId, text, overrideUsername, overrideIconUrl string, ...) (*model.Post, *model.AppError)
- func DeactivateMfa(userId string) *model.AppError
- func DeleteFlaggedPost(userId string, post *model.Post)
- func DeletePostFiles(post *model.Post)
- func DoesStatusAllowPushNotification(user *model.User, status *model.Status, channelId string) bool
- func FindTeamByName(name string) bool
- func GetAllStatuses() map[string]*model.Status
- func GetAllTeamListings(c *Context, w http.ResponseWriter, r *http.Request)
- func GetAuthData(code string) *model.AuthData
- func GetAuthorizationCode(c *Context, service string, props map[string]string, loginHint string) (string, *model.AppError)
- func GetIpAddress(r *http.Request) string
- func GetLogs() ([]string, *model.AppError)
- func GetProtocol(r *http.Request) string
- func GetSession(token string) *model.Session
- func GetStatus(userId string) (*model.Status, *model.AppError)
- func GetStatusFromCache(userId string) *model.Status
- func GetStatusesByIds(userIds []string) (map[string]interface{}, *model.AppError)
- func Handle404(w http.ResponseWriter, r *http.Request)
- func HandleEtag(etag string, routeName string, w http.ResponseWriter, r *http.Request) bool
- func HasPermissionTo(user *model.User, permission *model.Permission) bool
- func HasPermissionToChannel(user *model.User, teamMember *model.TeamMember, ...) bool
- func HasPermissionToChannelByPostContext(c *Context, postId string, permission *model.Permission) bool
- func HasPermissionToChannelContext(c *Context, channelId string, permission *model.Permission) bool
- func HasPermissionToContext(c *Context, permission *model.Permission) bool
- func HasPermissionToCurrentTeamContext(c *Context, permission *model.Permission) bool
- func HasPermissionToTeam(user *model.User, teamMember *model.TeamMember, permission *model.Permission) bool
- func HasPermissionToTeamContext(c *Context, teamId string, permission *model.Permission) bool
- func HasPermissionToUser(c *Context, userId string) bool
- func HubRegister(webConn *WebConn)
- func HubStart()
- func HubStop()
- func HubUnregister(webConn *WebConn)
- func ImportChannel(channel *model.Channel) *model.Channel
- func ImportFile(file io.Reader, teamId string, channelId string, userId string, ...) (*model.FileInfo, error)
- func ImportIncomingWebhookPost(post *model.Post, props model.StringInterface)
- func ImportPost(post *model.Post)
- func ImportUser(team *model.Team, user *model.User) *model.User
- func InitAdmin()
- func InitApi()
- func InitChannel()
- func InitCommand()
- func InitDeprecated()
- func InitEmailBatching()
- func InitEmoji()
- func InitFile()
- func InitGeneral()
- func InitLicense()
- func InitOAuth()
- func InitPost()
- func InitPreference()
- func InitReaction()
- func InitRouter()
- func InitStatus()
- func InitStores()
- func InitTeam()
- func InitUser()
- func InitWebSocket()
- func InitWebhook()
- func InitWebrtc()
- func InvalidateAllCaches()
- func InvalidateCacheForChannel(channel *model.Channel)
- func InvalidateCacheForChannelByNameSkipClusterSend(teamId, name string)
- func InvalidateCacheForChannelMembers(channelId string)
- func InvalidateCacheForChannelMembersSkipClusterSend(channelId string)
- func InvalidateCacheForChannelPosts(channelId string)
- func InvalidateCacheForChannelPostsSkipClusterSend(channelId string)
- func InvalidateCacheForChannelSkipClusterSend(channelId string)
- func InvalidateCacheForUser(userId string)
- func InvalidateCacheForUserSkipClusterSend(userId string)
- func InvalidateCacheForWebhook(webhookId string)
- func InvalidateCacheForWebhookSkipClusterSend(webhookId string)
- func InvalidateWebConnSessionCacheForUser(userId string)
- func InviteMembers(team *model.Team, senderName string, invites []string, siteURL string)
- func IsApiCall(r *http.Request) bool
- func IsUserAway(lastActivityAt int64) bool
- func IsUsernameTaken(name string) bool
- func IsVerifyHashRequired(user *model.User, team *model.Team, hash string) bool
- func JoinChannelById(c *Context, userId string, channelId string) (*model.AppError, *model.Channel)
- func JoinChannelByName(c *Context, userId string, teamId string, channelName string) (*model.AppError, *model.Channel)
- func JoinDefaultChannels(teamId string, user *model.User, channelRole string) *model.AppError
- func JoinUserToTeam(team *model.Team, user *model.User) *model.AppError
- func JoinUserToTeamById(teamId string, user *model.User) *model.AppError
- func LeaveTeam(team *model.Team, user *model.User) *model.AppError
- func LinkUserToTeam(user *model.User, team *model.Team)
- func LoadLicense()
- func LoginByOAuth(c *Context, w http.ResponseWriter, r *http.Request, service string, ...) *model.User
- func Logout(c *Context, w http.ResponseWriter, r *http.Request)
- func MakeUserChannelAdmin(user *model.User, channel *model.Channel)
- func MakeUserChannelUser(user *model.User, channel *model.Channel)
- func MoveFile(oldPath, newPath string) *model.AppError
- func NewInvalidParamError(where string, name string) *model.AppError
- func NewInvalidWebSocketParamError(action string, name string) *model.AppError
- func NewServer()
- func PermanentDeleteAllUsers() *model.AppError
- func PermanentDeleteTeam(team *model.Team) *model.AppError
- func PermanentDeleteUser(user *model.User) *model.AppError
- func PostUpdateChannelDisplayNameMessage(c *Context, channelId string, ...)
- func PostUpdateChannelHeaderMessage(c *Context, channelId string, oldChannelHeader, newChannelHeader string)
- func PostUserAddRemoveMessage(c *Context, channelId string, message, postType string)
- func Publish(message *model.WebSocketEvent)
- func PublishSkipClusterSend(message *model.WebSocketEvent)
- func ReadFile(path string) ([]byte, *model.AppError)
- func RegisterCommandProvider(newProvider CommandProvider)
- func RemoveAllSessionsForUserId(userId string)
- func RemoveAllSessionsForUserIdSkipClusterSend(userId string)
- func RemoveLicense() *model.AppError
- func RemoveUserFromChannel(userIdToRemove string, removerUserId string, channel *model.Channel) *model.AppError
- func RenderWebError(err *model.AppError, w http.ResponseWriter, r *http.Request)
- func ResetPassword(c *Context, userId, newPassword string) *model.AppError
- func ReturnStatusOK(w http.ResponseWriter)
- func RevokeAccessToken(token string) *model.AppError
- func RevokeAllSession(c *Context, userId string)
- func RevokeAllSessionsNoContext(userId string) *model.AppError
- func RevokeSessionById(c *Context, sessionId string)
- func RevokeWebrtcToken(sessionId string)
- func SaveLicense(licenseBytes []byte) (*model.License, *model.AppError)
- func SendEmailChangeVerifyEmail(c *Context, userId, newUserEmail, siteURL string)
- func SendEphemeralPost(teamId, userId string, post *model.Post)
- func SendVerifyEmail(c *Context, userId, userEmail, siteURL string)
- func SetActiveChannel(userId string, channelId string) *model.AppError
- func SetStatusAwayIfNeeded(userId string, manual bool)
- func SetStatusOffline(userId string, manual bool)
- func SetStatusOnline(userId string, sessionId string, manual bool)
- func SlackAddBotUser(teamId string, log *bytes.Buffer) *model.User
- func SlackAddChannels(teamId string, slackchannels []SlackChannel, posts map[string][]SlackPost, ...) map[string]*model.Channel
- func SlackAddPosts(teamId string, channel *model.Channel, posts []SlackPost, ...)
- func SlackAddUsers(teamId string, slackusers []SlackUser, log *bytes.Buffer) map[string]*model.User
- func SlackConvertChannelMentions(channels []SlackChannel, posts map[string][]SlackPost) map[string][]SlackPost
- func SlackConvertChannelName(channelName string) string
- func SlackConvertPostsMarkup(posts map[string][]SlackPost) map[string][]SlackPost
- func SlackConvertTimeStamp(ts string) int64
- func SlackConvertUserMentions(users []SlackUser, posts map[string][]SlackPost) map[string][]SlackPost
- func SlackImport(fileData multipart.File, fileSize int64, teamID string) (*model.AppError, *bytes.Buffer)
- func SlackSanitiseChannelProperties(channel model.Channel) model.Channel
- func SlackUploadFile(sPost SlackPost, uploads map[string]*zip.File, teamId string, channelId string, ...) (*model.FileInfo, bool)
- func StartServer()
- func StopServer()
- func TearDown()
- func TotalWebsocketConnections() int
- func UpdateActive(user *model.User, active bool) (*model.User, *model.AppError)
- func UpdateUserRoles(user *model.User, newRoles string) (*model.User, *model.AppError)
- func UpdateUserToNonTeamAdmin(user *model.User, team *model.Team)
- func UpdateUserToTeamAdmin(user *model.User, team *model.Team)
- func UserRequired(h func(*Context, http.ResponseWriter, *http.Request)) http.Handler
- func WaitForChannelMembership(channelId string, userId string)
- func WriteFile(f []byte, path string) *model.AppError
- type AutoChannelCreator
- type AutoPostCreator
- type AutoTeamCreator
- type AutoUserCreator
- type AwayProvider
- type CollapseProvider
- type CommandProvider
- type Context
- func (c *Context) CheckTeamId()
- func (c *Context) GetCurrentTeamMember() *model.TeamMember
- func (c *Context) GetSiteURL() string
- func (c *Context) GetSiteURLHeader() string
- func (c *Context) GetTeamURL() string
- func (c *Context) GetTeamURLFromTeam(team *model.Team) string
- func (c *Context) LogAudit(extraInfo string)
- func (c *Context) LogAuditWithUserId(userId, extraInfo string)
- func (c *Context) LogDebug(err *model.AppError)
- func (c *Context) LogError(err *model.AppError)
- func (c *Context) MfaRequired()
- func (c *Context) RemoveSessionCookie(w http.ResponseWriter, r *http.Request)
- func (c *Context) SetInvalidParam(where string, name string)
- func (c *Context) SetSiteURL(url string)
- func (c *Context) SetSiteURLHeader(url string)
- func (c *Context) SetTeamURLFromSession()
- func (c *Context) SetUnknownError(where string, details string)
- func (c *Context) SystemAdminRequired()
- func (c *Context) UserRequired()
- type CorsWrapper
- type EchoProvider
- type EmailBatchingJob
- type ExpandProvider
- type Hub
- type InvitePeopleProvider
- type JoinProvider
- type LoadTestProvider
- func (me *LoadTestProvider) ChannelsCommand(c *Context, channelId string, message string) *model.CommandResponse
- func (me *LoadTestProvider) DoCommand(c *Context, args *model.CommandArgs, message string) *model.CommandResponse
- func (me *LoadTestProvider) GetCommand(c *Context) *model.Command
- func (me *LoadTestProvider) GetTrigger() string
- func (me *LoadTestProvider) HelpCommand(c *Context, channelId string, message string) *model.CommandResponse
- func (me *LoadTestProvider) JsonCommand(c *Context, channelId string, message string) *model.CommandResponse
- func (me *LoadTestProvider) PostsCommand(c *Context, channelId string, message string) *model.CommandResponse
- func (me *LoadTestProvider) SetupCommand(c *Context, channelId string, message string) *model.CommandResponse
- func (me *LoadTestProvider) UrlCommand(c *Context, channelId string, message string) *model.CommandResponse
- func (me *LoadTestProvider) UsersCommand(c *Context, channelId string, message string) *model.CommandResponse
- type LogoutProvider
- type MeProvider
- type OfflineProvider
- type OnlineProvider
- type Routes
- type Server
- type ShortcutsProvider
- type ShrugProvider
- type SlackAttachment
- type SlackChannel
- type SlackComment
- type SlackFile
- type SlackPost
- type SlackUser
- type TeamEnvironment
- type TestEnvironment
- type TestHelper
- func (me *TestHelper) CreateChannel(client *model.Client, team *model.Team) *model.Channel
- func (me *TestHelper) CreateClient() *model.Client
- func (me *TestHelper) CreatePost(client *model.Client, channel *model.Channel) *model.Post
- func (me *TestHelper) CreatePrivateChannel(client *model.Client, team *model.Team) *model.Channel
- func (me *TestHelper) CreateTeam(client *model.Client) *model.Team
- func (me *TestHelper) CreateUser(client *model.Client) *model.User
- func (me *TestHelper) CreateWebSocketClient() (*model.WebSocketClient, *model.AppError)
- func (me *TestHelper) InitBasic() *TestHelper
- func (me *TestHelper) InitSystemAdmin() *TestHelper
- func (me *TestHelper) LoginBasic()
- func (me *TestHelper) LoginBasic2()
- func (me *TestHelper) LoginSystemAdmin()
- type VaryBy
- type WebConn
- type WebSocketRouter
Constants ¶
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 ( 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 )
View Source
const ( EXPIRED_LICENSE_ERROR = "api.license.add_license.expired.app_error" INVALID_LICENSE_ERROR = "api.license.add_license.invalid.app_error" )
View Source
const ( TRIGGERWORDS_FULL = 0 TRIGGERWORDS_STARTSWITH = 1 )
View Source
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 )
View Source
const ( DEADLOCK_TICKER = 15 * time.Second // check every 15 seconds DEADLOCK_WARN = 4096 // number of buffered messages before printing stack trace )
View Source
const (
CMD_AWAY = "away"
)
View Source
const (
CMD_ECHO = "echo"
)
View Source
const (
CMD_INVITE_PEOPLE = "invite_people"
)
View Source
const (
CMD_JOIN = "join"
)
View Source
const (
CMD_LOADTEST = "loadtest"
)
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_SHORTCUTS = "shortcuts"
)
View Source
const (
CMD_SHRUG = "shrug"
)
View Source
const (
EMAIL_BATCHING_TASK_NAME = "Email Batching"
)
View Source
const (
SOCKET_MAX_MESSAGE_SIZE_KB = 8 * 1024 // 8KB
)
View Source
const TIME_TO_WAIT_FOR_CONNECTIONS_TO_CLOSE_ON_SERVER_SHUTDOWN = time.Second
Variables ¶
View Source
var ( TEAM_NAME_LEN = utils.Range{10, 20} TEAM_DOMAIN_NAME_LEN = utils.Range{10, 20} TEAM_EMAIL_LEN = utils.Range{15, 30} USER_NAME_LEN = utils.Range{5, 20} USER_EMAIL_LEN = utils.Range{15, 30} CHANNEL_DISPLAY_NAME_LEN = utils.Range{10, 20} CHANNEL_NAME_LEN = utils.Range{5, 20} POST_MESSAGE_LEN = utils.Range{100, 400} POST_HASHTAGS_NUM = utils.Range{5, 10} POST_MENTIONS_NUM = utils.Range{0, 3} TEST_IMAGE_FILENAMES = []string{"test.png", "testjpg.jpg", "testgif.gif"} )
Functions ¶
func ActivateMfa ¶
func AddSessionToCache ¶
func AddStatusCache ¶
func AddUserToChannel ¶ added in v1.1.0
func ApiAdminSystemRequired ¶
func ApiAppHandler ¶
func ApiUserRequired ¶
func ApiUserRequiredActivity ¶
func ApiUserRequiredMfa ¶
func ApiWebSocketHandler ¶
func ApiWebSocketHandler(wh func(*model.WebSocketRequest) (map[string]interface{}, *model.AppError)) *webSocketHandler
func AppHandler ¶
func AppHandlerIndependent ¶
func AuthorizeOAuthUser ¶
func CheckUserDomain ¶
Check that a user's email domain matches a list of space-delimited domains as a string.
func ClearStatusCache ¶
func ClearStatusCache()
func CompleteSwitchWithOAuth ¶ added in v1.4.0
func CompleteSwitchWithOAuth(c *Context, w http.ResponseWriter, r *http.Request, service string, userData io.ReadCloser, email string)
func CreateBasicUser ¶
Basic test team and user so you always know one
func CreateChannel ¶
func CreateCommandPost ¶
func CreateCommandPost(c *Context, post *model.Post, response *model.CommandResponse)
func CreateDefaultChannels ¶
func CreateDirectChannel ¶
func CreateOAuthUser ¶ added in v1.4.0
func CreatePost ¶
func CreateWebhookPost ¶ added in v1.2.1
func DeactivateMfa ¶
func DeleteFlaggedPost ¶
func DeletePostFiles ¶
func FindTeamByName ¶
func GetAllStatuses ¶
func GetAllTeamListings ¶
func GetAllTeamListings(c *Context, w http.ResponseWriter, r *http.Request)
func GetAuthData ¶
func GetAuthorizationCode ¶
func GetIpAddress ¶
func GetProtocol ¶
func GetSession ¶ added in v1.2.1
func GetStatusFromCache ¶
func GetStatusesByIds ¶
func HandleEtag ¶
func HasPermissionTo ¶
func HasPermissionTo(user *model.User, permission *model.Permission) bool
func HasPermissionToChannel ¶
func HasPermissionToChannel(user *model.User, teamMember *model.TeamMember, channelMember *model.ChannelMember, permission *model.Permission) bool
func HasPermissionToChannelByPostContext ¶
func HasPermissionToChannelByPostContext(c *Context, postId string, permission *model.Permission) bool
func HasPermissionToChannelContext ¶
func HasPermissionToChannelContext(c *Context, channelId string, permission *model.Permission) bool
func HasPermissionToContext ¶
func HasPermissionToContext(c *Context, permission *model.Permission) bool
func HasPermissionToCurrentTeamContext ¶
func HasPermissionToCurrentTeamContext(c *Context, permission *model.Permission) bool
func HasPermissionToTeam ¶
func HasPermissionToTeam(user *model.User, teamMember *model.TeamMember, permission *model.Permission) bool
func HasPermissionToTeamContext ¶
func HasPermissionToTeamContext(c *Context, teamId string, permission *model.Permission) bool
func HasPermissionToUser ¶
func HubRegister ¶
func HubRegister(webConn *WebConn)
func HubUnregister ¶
func HubUnregister(webConn *WebConn)
func ImportFile ¶
func ImportIncomingWebhookPost ¶
func ImportIncomingWebhookPost(post *model.Post, props model.StringInterface)
func ImportPost ¶
func InitChannel ¶
func InitChannel()
func InitCommand ¶
func InitCommand()
func InitDeprecated ¶
func InitDeprecated()
func InitEmailBatching ¶
func InitEmailBatching()
func InitGeneral ¶
func InitGeneral()
func InitLicense ¶
func InitLicense()
func InitPreference ¶ added in v1.2.1
func InitPreference()
func InitReaction ¶
func InitReaction()
func InitRouter ¶
func InitRouter()
func InitStatus ¶
func InitStatus()
func InitStores ¶
func InitStores()
func InitWebSocket ¶
func InitWebSocket()
func InitWebhook ¶
func InitWebhook()
func InitWebrtc ¶
func InitWebrtc()
func InvalidateAllCaches ¶
func InvalidateAllCaches()
func InvalidateCacheForChannelByNameSkipClusterSend ¶
func InvalidateCacheForChannelByNameSkipClusterSend(teamId, name string)
func InvalidateCacheForChannelMembers ¶
func InvalidateCacheForChannelMembers(channelId string)
func InvalidateCacheForChannelMembersSkipClusterSend ¶
func InvalidateCacheForChannelMembersSkipClusterSend(channelId string)
func InvalidateCacheForChannelPosts ¶
func InvalidateCacheForChannelPosts(channelId string)
func InvalidateCacheForChannelPostsSkipClusterSend ¶
func InvalidateCacheForChannelPostsSkipClusterSend(channelId string)
func InvalidateCacheForChannelSkipClusterSend ¶
func InvalidateCacheForChannelSkipClusterSend(channelId string)
func InvalidateCacheForUser ¶
func InvalidateCacheForUser(userId string)
func InvalidateCacheForUserSkipClusterSend ¶
func InvalidateCacheForUserSkipClusterSend(userId string)
func InvalidateCacheForWebhook ¶
func InvalidateCacheForWebhook(webhookId string)
func InvalidateCacheForWebhookSkipClusterSend ¶
func InvalidateCacheForWebhookSkipClusterSend(webhookId string)
func InvalidateWebConnSessionCacheForUser ¶
func InvalidateWebConnSessionCacheForUser(userId string)
func InviteMembers ¶
func IsUserAway ¶
func IsUsernameTaken ¶
Check if the username is already used by another user. Return false if the username is invalid.
func IsVerifyHashRequired ¶
func JoinChannelById ¶
func JoinChannelByName ¶
func JoinDefaultChannels ¶
func LoadLicense ¶
func LoadLicense()
func LoginByOAuth ¶ added in v1.4.0
func PermanentDeleteAllUsers ¶
func PermanentDeleteTeam ¶ added in v1.3.0
func PermanentDeleteUser ¶ added in v1.3.0
func Publish ¶
func Publish(message *model.WebSocketEvent)
func PublishSkipClusterSend ¶
func PublishSkipClusterSend(message *model.WebSocketEvent)
func RegisterCommandProvider ¶
func RegisterCommandProvider(newProvider CommandProvider)
func RemoveAllSessionsForUserId ¶
func RemoveAllSessionsForUserId(userId string)
func RemoveAllSessionsForUserIdSkipClusterSend ¶
func RemoveAllSessionsForUserIdSkipClusterSend(userId string)
func RemoveLicense ¶
func RemoveUserFromChannel ¶ added in v1.1.0
func RenderWebError ¶
func ReturnStatusOK ¶
func ReturnStatusOK(w http.ResponseWriter)
func RevokeAccessToken ¶
func RevokeAllSession ¶
IF YOU UPDATE THIS PLEASE UPDATE BELOW
func RevokeAllSessionsNoContext ¶
UGH... If you update this please update above
func RevokeSessionById ¶ added in v1.4.0
func RevokeWebrtcToken ¶
func RevokeWebrtcToken(sessionId string)
func SendEphemeralPost ¶
func SendVerifyEmail ¶
func SetStatusAwayIfNeeded ¶
func SetStatusOffline ¶
func SetStatusOnline ¶
func SlackAddChannels ¶
func SlackAddPosts ¶
func SlackAddUsers ¶
func SlackConvertChannelMentions ¶
func SlackConvertChannelMentions(channels []SlackChannel, posts map[string][]SlackPost) map[string][]SlackPost
func SlackConvertChannelName ¶
func SlackConvertPostsMarkup ¶
func SlackConvertTimeStamp ¶
func SlackImport ¶
func SlackUploadFile ¶
func StartServer ¶
func StartServer()
func StopServer ¶
func StopServer()
func TotalWebsocketConnections ¶
func TotalWebsocketConnections() int
func UpdateActive ¶ added in v1.3.0
func UpdateUserRoles ¶
func UserRequired ¶
Types ¶
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 ¶
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 (*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 ¶
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(client *model.Client, team *model.Team) *AutoUserCreator
func (*AutoUserCreator) CreateTestUsers ¶
type AwayProvider ¶
type AwayProvider struct { }
func (*AwayProvider) DoCommand ¶
func (me *AwayProvider) DoCommand(c *Context, args *model.CommandArgs, message string) *model.CommandResponse
func (*AwayProvider) GetCommand ¶
func (me *AwayProvider) GetCommand(c *Context) *model.Command
func (*AwayProvider) GetTrigger ¶
func (me *AwayProvider) GetTrigger() string
type CollapseProvider ¶
type CollapseProvider struct { }
func (*CollapseProvider) DoCommand ¶
func (me *CollapseProvider) DoCommand(c *Context, args *model.CommandArgs, message string) *model.CommandResponse
func (*CollapseProvider) GetCommand ¶
func (me *CollapseProvider) GetCommand(c *Context) *model.Command
func (*CollapseProvider) GetTrigger ¶
func (me *CollapseProvider) GetTrigger() string
type CommandProvider ¶
type CommandProvider interface { GetTrigger() string GetCommand(c *Context) *model.Command DoCommand(c *Context, args *model.CommandArgs, message string) *model.CommandResponse }
func GetCommandProvider ¶
func GetCommandProvider(name string) CommandProvider
type Context ¶
type Context struct { Session model.Session RequestId string IpAddress string Path string Err *model.AppError T goi18n.TranslateFunc Locale string TeamId string // contains filtered or unexported fields }
func (*Context) CheckTeamId ¶
func (c *Context) CheckTeamId()
func (*Context) GetCurrentTeamMember ¶
func (c *Context) GetCurrentTeamMember() *model.TeamMember
func (*Context) GetSiteURL ¶
func (*Context) GetSiteURLHeader ¶
func (*Context) GetTeamURL ¶
func (*Context) LogAuditWithUserId ¶
func (*Context) MfaRequired ¶
func (c *Context) MfaRequired()
func (*Context) RemoveSessionCookie ¶
func (c *Context) RemoveSessionCookie(w http.ResponseWriter, r *http.Request)
func (*Context) SetInvalidParam ¶
func (*Context) SetSiteURL ¶
func (*Context) SetSiteURLHeader ¶
func (*Context) SetTeamURLFromSession ¶ added in v1.1.0
func (c *Context) SetTeamURLFromSession()
func (*Context) SetUnknownError ¶
func (*Context) SystemAdminRequired ¶
func (c *Context) SystemAdminRequired()
func (*Context) UserRequired ¶
func (c *Context) UserRequired()
type CorsWrapper ¶
type CorsWrapper struct {
// contains filtered or unexported fields
}
func (*CorsWrapper) ServeHTTP ¶
func (cw *CorsWrapper) ServeHTTP(w http.ResponseWriter, r *http.Request)
type EchoProvider ¶
type EchoProvider struct { }
func (*EchoProvider) DoCommand ¶
func (me *EchoProvider) DoCommand(c *Context, args *model.CommandArgs, message string) *model.CommandResponse
func (*EchoProvider) GetCommand ¶
func (me *EchoProvider) GetCommand(c *Context) *model.Command
func (*EchoProvider) GetTrigger ¶
func (me *EchoProvider) GetTrigger() string
type EmailBatchingJob ¶
type EmailBatchingJob struct {
// contains filtered or unexported fields
}
func MakeEmailBatchingJob ¶
func MakeEmailBatchingJob(bufferSize int) *EmailBatchingJob
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(c *Context, args *model.CommandArgs, message string) *model.CommandResponse
func (*ExpandProvider) GetCommand ¶
func (me *ExpandProvider) GetCommand(c *Context) *model.Command
func (*ExpandProvider) GetTrigger ¶
func (me *ExpandProvider) GetTrigger() string
type Hub ¶
type Hub struct { ExplicitStop bool // contains filtered or unexported fields }
func GetHubForUserId ¶
func (*Hub) Broadcast ¶
func (h *Hub) Broadcast(message *model.WebSocketEvent)
func (*Hub) InvalidateUser ¶
func (*Hub) Unregister ¶
type InvitePeopleProvider ¶
type InvitePeopleProvider struct { }
func (*InvitePeopleProvider) DoCommand ¶
func (me *InvitePeopleProvider) DoCommand(c *Context, args *model.CommandArgs, message string) *model.CommandResponse
func (*InvitePeopleProvider) GetCommand ¶
func (me *InvitePeopleProvider) GetCommand(c *Context) *model.Command
func (*InvitePeopleProvider) GetTrigger ¶
func (me *InvitePeopleProvider) GetTrigger() string
type JoinProvider ¶
type JoinProvider struct { }
func (*JoinProvider) DoCommand ¶
func (me *JoinProvider) DoCommand(c *Context, args *model.CommandArgs, message string) *model.CommandResponse
func (*JoinProvider) GetCommand ¶
func (me *JoinProvider) GetCommand(c *Context) *model.Command
func (*JoinProvider) GetTrigger ¶
func (me *JoinProvider) GetTrigger() string
type LoadTestProvider ¶
type LoadTestProvider struct { }
func (*LoadTestProvider) ChannelsCommand ¶
func (me *LoadTestProvider) ChannelsCommand(c *Context, channelId string, message string) *model.CommandResponse
func (*LoadTestProvider) DoCommand ¶
func (me *LoadTestProvider) DoCommand(c *Context, args *model.CommandArgs, message string) *model.CommandResponse
func (*LoadTestProvider) GetCommand ¶
func (me *LoadTestProvider) GetCommand(c *Context) *model.Command
func (*LoadTestProvider) GetTrigger ¶
func (me *LoadTestProvider) GetTrigger() string
func (*LoadTestProvider) HelpCommand ¶
func (me *LoadTestProvider) HelpCommand(c *Context, channelId string, message string) *model.CommandResponse
func (*LoadTestProvider) JsonCommand ¶
func (me *LoadTestProvider) JsonCommand(c *Context, channelId string, message string) *model.CommandResponse
func (*LoadTestProvider) PostsCommand ¶
func (me *LoadTestProvider) PostsCommand(c *Context, channelId string, message string) *model.CommandResponse
func (*LoadTestProvider) SetupCommand ¶
func (me *LoadTestProvider) SetupCommand(c *Context, channelId string, message string) *model.CommandResponse
func (*LoadTestProvider) UrlCommand ¶
func (me *LoadTestProvider) UrlCommand(c *Context, channelId string, message string) *model.CommandResponse
func (*LoadTestProvider) UsersCommand ¶
func (me *LoadTestProvider) UsersCommand(c *Context, channelId string, message string) *model.CommandResponse
type LogoutProvider ¶
type LogoutProvider struct { }
func (*LogoutProvider) DoCommand ¶
func (me *LogoutProvider) DoCommand(c *Context, args *model.CommandArgs, message string) *model.CommandResponse
func (*LogoutProvider) GetCommand ¶
func (me *LogoutProvider) GetCommand(c *Context) *model.Command
func (*LogoutProvider) GetTrigger ¶
func (me *LogoutProvider) GetTrigger() string
type MeProvider ¶
type MeProvider struct { }
func (*MeProvider) DoCommand ¶
func (me *MeProvider) DoCommand(c *Context, args *model.CommandArgs, message string) *model.CommandResponse
func (*MeProvider) GetCommand ¶
func (me *MeProvider) GetCommand(c *Context) *model.Command
func (*MeProvider) GetTrigger ¶
func (me *MeProvider) GetTrigger() string
type OfflineProvider ¶
type OfflineProvider struct { }
func (*OfflineProvider) DoCommand ¶
func (me *OfflineProvider) DoCommand(c *Context, args *model.CommandArgs, message string) *model.CommandResponse
func (*OfflineProvider) GetCommand ¶
func (me *OfflineProvider) GetCommand(c *Context) *model.Command
func (*OfflineProvider) GetTrigger ¶
func (me *OfflineProvider) GetTrigger() string
type OnlineProvider ¶
type OnlineProvider struct { }
func (*OnlineProvider) DoCommand ¶
func (me *OnlineProvider) DoCommand(c *Context, args *model.CommandArgs, message string) *model.CommandResponse
func (*OnlineProvider) GetCommand ¶
func (me *OnlineProvider) GetCommand(c *Context) *model.Command
func (*OnlineProvider) GetTrigger ¶
func (me *OnlineProvider) GetTrigger() string
type Routes ¶
type Routes struct { Root *mux.Router // ” ApiRoot *mux.Router // 'api/v3' Users *mux.Router // 'api/v3/users' NeedUser *mux.Router // 'api/v3/users/{user_id:[A-Za-z0-9]+}' Teams *mux.Router // 'api/v3/teams' NeedTeam *mux.Router // 'api/v3/teams/{team_id:[A-Za-z0-9]+}' Channels *mux.Router // 'api/v3/teams/{team_id:[A-Za-z0-9]+}/channels' NeedChannel *mux.Router // 'api/v3/teams/{team_id:[A-Za-z0-9]+}/channels/{channel_id:[A-Za-z0-9]+}' NeedChannelName *mux.Router // 'api/v3/teams/{team_id:[A-Za-z0-9]+}/channels/name/{channel_name:[A-Za-z0-9_-]+}' Posts *mux.Router // 'api/v3/teams/{team_id:[A-Za-z0-9]+}/channels/{channel_id:[A-Za-z0-9]+}/posts' NeedPost *mux.Router // 'api/v3/teams/{team_id:[A-Za-z0-9]+}/channels/{channel_id:[A-Za-z0-9]+}/posts/{post_id:[A-Za-z0-9]+}' Commands *mux.Router // 'api/v3/teams/{team_id:[A-Za-z0-9]+}/commands' Hooks *mux.Router // 'api/v3/teams/{team_id:[A-Za-z0-9]+}/hooks' TeamFiles *mux.Router // 'api/v3/teams/{team_id:[A-Za-z0-9]+}/files' Files *mux.Router // 'api/v3/files' NeedFile *mux.Router // 'api/v3/files/{file_id:[A-Za-z0-9]+}' OAuth *mux.Router // 'api/v3/oauth' Admin *mux.Router // 'api/v3/admin' General *mux.Router // 'api/v3/general' Preferences *mux.Router // 'api/v3/preferences' License *mux.Router // 'api/v3/license' Public *mux.Router // 'api/v3/public' Emoji *mux.Router // 'api/v3/emoji' Webrtc *mux.Router // 'api/v3/webrtc' WebSocket *WebSocketRouter // websocket api }
var BaseRoutes *Routes
type ShortcutsProvider ¶
type ShortcutsProvider struct { }
func (*ShortcutsProvider) DoCommand ¶
func (me *ShortcutsProvider) DoCommand(c *Context, args *model.CommandArgs, message string) *model.CommandResponse
func (*ShortcutsProvider) GetCommand ¶
func (me *ShortcutsProvider) GetCommand(c *Context) *model.Command
func (*ShortcutsProvider) GetTrigger ¶
func (me *ShortcutsProvider) GetTrigger() string
type ShrugProvider ¶
type ShrugProvider struct { }
func (*ShrugProvider) DoCommand ¶
func (me *ShrugProvider) DoCommand(c *Context, args *model.CommandArgs, message string) *model.CommandResponse
func (*ShrugProvider) GetCommand ¶
func (me *ShrugProvider) GetCommand(c *Context) *model.Command
func (*ShrugProvider) GetTrigger ¶
func (me *ShrugProvider) GetTrigger() string
type SlackAttachment ¶
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 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 []SlackAttachment `json:"attachments"` }
type SlackUser ¶
type TeamEnvironment ¶ added in v1.2.1
type TestEnvironment ¶ added in v1.2.1
type TestEnvironment struct { Teams []*model.Team Environments []TeamEnvironment }
type TestHelper ¶
type TestHelper struct { BasicClient *model.Client BasicTeam *model.Team BasicUser *model.User BasicUser2 *model.User BasicChannel *model.Channel BasicPost *model.Post SystemAdminClient *model.Client SystemAdminTeam *model.Team SystemAdminUser *model.User SystemAdminChannel *model.Channel }
func Setup ¶
func Setup() *TestHelper
func SetupEnterprise ¶
func SetupEnterprise() *TestHelper
func (*TestHelper) CreateChannel ¶
func (*TestHelper) CreateClient ¶
func (me *TestHelper) CreateClient() *model.Client
func (*TestHelper) CreatePost ¶
func (*TestHelper) CreatePrivateChannel ¶
func (*TestHelper) CreateTeam ¶
func (me *TestHelper) CreateTeam(client *model.Client) *model.Team
func (*TestHelper) CreateUser ¶
func (me *TestHelper) CreateUser(client *model.Client) *model.User
func (*TestHelper) CreateWebSocketClient ¶
func (me *TestHelper) CreateWebSocketClient() (*model.WebSocketClient, *model.AppError)
func (*TestHelper) InitBasic ¶
func (me *TestHelper) InitBasic() *TestHelper
func (*TestHelper) InitSystemAdmin ¶
func (me *TestHelper) InitSystemAdmin() *TestHelper
func (*TestHelper) LoginBasic ¶
func (me *TestHelper) LoginBasic()
func (*TestHelper) LoginBasic2 ¶
func (me *TestHelper) LoginBasic2()
func (*TestHelper) LoginSystemAdmin ¶
func (me *TestHelper) LoginSystemAdmin()
type WebConn ¶
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 (*WebConn) InvalidateCache ¶
func (webCon *WebConn) InvalidateCache()
func (*WebConn) IsMemberOfTeam ¶
func (*WebConn) ShouldSendEvent ¶
func (webCon *WebConn) ShouldSendEvent(msg *model.WebSocketEvent) bool
type WebSocketRouter ¶
type WebSocketRouter struct {
// contains filtered or unexported fields
}
func NewWebSocketRouter ¶
func NewWebSocketRouter() *WebSocketRouter
func (*WebSocketRouter) Handle ¶
func (wr *WebSocketRouter) Handle(action string, handler *webSocketHandler)
func (*WebSocketRouter) ReturnWebSocketError ¶
func (wr *WebSocketRouter) ReturnWebSocketError(conn *WebConn, r *model.WebSocketRequest, err *model.AppError)
func (*WebSocketRouter) ServeWebSocket ¶
func (wr *WebSocketRouter) ServeWebSocket(conn *WebConn, r *model.WebSocketRequest)
Source Files ¶
- admin.go
- api.go
- apitestlib.go
- authentication.go
- authorization.go
- auto_channels.go
- auto_constants.go
- auto_environment.go
- auto_posts.go
- auto_teams.go
- auto_users.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
- context.go
- deprecated.go
- email_batching.go
- emoji.go
- file.go
- general.go
- import.go
- license.go
- oauth.go
- post.go
- preference.go
- reaction.go
- server.go
- slackimport.go
- status.go
- team.go
- user.go
- web_conn.go
- web_hub.go
- webhook.go
- webrtc.go
- websocket.go
- websocket_handler.go
- websocket_router.go
Click to show internal directories.
Click to hide internal directories.