Documentation ¶
Index ¶
- Constants
- Variables
- func ActivateMfa(userId, token string) *model.AppError
- func AddSessionToCache(session *model.Session)
- func AddUserToChannel(user *model.User, channel *model.Channel) (*model.ChannelMember, *model.AppError)
- func ApiAdminSystemRequired(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 ApiUserRequiredTrustRequester(h func(*Context, http.ResponseWriter, *http.Request)) http.Handler
- func AppHandler(h func(*Context, http.ResponseWriter, *http.Request)) http.Handler
- func AppHandlerIndependent(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 CheckUserDomain(user *model.User, domains string) bool
- 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 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 DeletePostFilesAndForget(teamId string, post *model.Post)
- func ExportChannels(writer ExportWriter, options *ExportOptions, teamId string) *model.AppError
- func ExportLocalStorage(writer ExportWriter, options *ExportOptions, teamId string) *model.AppError
- func ExportPosts(writer ExportWriter, options *ExportOptions, channelId string) *model.AppError
- func ExportTeams(writer ExportWriter, options *ExportOptions) *model.AppError
- func ExportToFile(options *ExportOptions) (link string, err *model.AppError)
- func ExportToWriter(w io.Writer, options *ExportOptions) *model.AppError
- func ExportUsers(writer ExportWriter, options *ExportOptions, teamId string) *model.AppError
- func FindTeamByName(name string) bool
- 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 GetProtocol(r *http.Request) string
- func GetSession(token string) *model.Session
- func Handle404(w http.ResponseWriter, r *http.Request)
- func HandleEtag(etag string, w http.ResponseWriter, r *http.Request) bool
- func ImportChannel(channel *model.Channel) *model.Channel
- func ImportPost(post *model.Post)
- func ImportUser(team *model.Team, user *model.User) *model.User
- func InitAdmin()
- func InitApi()
- func InitChannel()
- func InitCommand()
- func InitFile()
- func InitLicense()
- func InitOAuth()
- func InitPost()
- func InitPreference()
- func InitTeam()
- func InitUser()
- func InitWebSocket()
- func InitWebhook()
- func InvalidateCacheForChannel(channelId string)
- func InvalidateCacheForUser(userId string)
- func InviteMembers(c *Context, team *model.Team, user *model.User, invites []string)
- func IsApiCall(r *http.Request) 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 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 MoveFile(oldPath, newPath string) *model.AppError
- func NewInvalidParamError(where string, name string) *model.AppError
- func NewServer()
- func PermanentDeleteAllUsers(c *Context) *model.AppError
- func PermanentDeleteTeam(c *Context, team *model.Team) *model.AppError
- func PermanentDeleteUser(c *Context, user *model.User) *model.AppError
- func PostUpdateChannelHeaderMessageAndForget(c *Context, channelId string, oldChannelHeader, newChannelHeader string)
- func PostUserAddRemoveMessageAndForget(c *Context, channelId string, message string)
- func PublishAndForget(message *model.Message)
- func ReadFile(path string) ([]byte, *model.AppError)
- func RegisterCommandProvider(newProvider CommandProvider)
- func RemoveAllSessionsForUserId(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 RevokeAccessToken(token string) *model.AppError
- func RevokeAllSession(c *Context, userId string)
- func RevokeSessionById(c *Context, sessionId string)
- func SaveLicense(licenseBytes []byte) (*model.License, *model.AppError)
- func SendEmailChangeVerifyEmailAndForget(c *Context, userId, newUserEmail, siteURL string)
- func SendEphemeralPost(teamId, userId string, post *model.Post)
- func SendVerifyEmailAndForget(c *Context, userId, userEmail, siteURL string)
- func SlackAddChannels(teamId string, slackchannels []SlackChannel, posts map[string][]SlackPost, ...) map[string]*model.Channel
- func SlackAddPosts(channel *model.Channel, posts []SlackPost, users map[string]*model.User)
- func SlackAddUsers(teamId string, slackusers []SlackUser, log *bytes.Buffer) map[string]*model.User
- func SlackConvertChannelName(channelName string) string
- func SlackConvertTimeStamp(ts string) int64
- func SlackImport(fileData multipart.File, fileSize int64, teamID string) (*model.AppError, *bytes.Buffer)
- func StartServer()
- func StopServer()
- func TearDown()
- func UpdateActive(c *Context, user *model.User, active bool) *model.User
- func UpdateUserRoles(c *Context, user *model.User, roles string) *model.User
- func UpdateUserToTeamAdmin(user *model.User, team *model.Team)
- func UserRequired(h func(*Context, http.ResponseWriter, *http.Request)) http.Handler
- func WriteFile(f []byte, path string) *model.AppError
- func WriteFileLocally(f []byte, path string) *model.AppError
- type AutoChannelCreator
- type AutoPostCreator
- type AutoTeamCreator
- type AutoUserCreator
- type CommandProvider
- type Context
- func (c *Context) GetSiteURL() string
- func (c *Context) GetTeamURL() string
- func (c *Context) GetTeamURLFromTeam(team *model.Team) string
- func (c *Context) HasPermissionsToChannel(sc store.StoreChannel, where string) bool
- func (c *Context) HasPermissionsToTeam(teamId string, where string) bool
- func (c *Context) HasPermissionsToUser(userId string, where string) bool
- func (c *Context) HasSystemAdminPermissions(where string) bool
- func (c *Context) IsSystemAdmin() bool
- func (c *Context) IsTeamAdmin() bool
- func (c *Context) LogAudit(extraInfo string)
- func (c *Context) LogAuditWithUserId(userId, extraInfo string)
- func (c *Context) LogError(err *model.AppError)
- func (c *Context) RemoveSessionCookie(w http.ResponseWriter, r *http.Request)
- func (c *Context) SetInvalidParam(where string, name 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 ExportOptions
- type ExportWriter
- type Hub
- type ImageGetResult
- type JoinProvider
- type LoadTestProvider
- func (me *LoadTestProvider) ChannelsCommand(c *Context, channelId string, message string) *model.CommandResponse
- func (me *LoadTestProvider) DoCommand(c *Context, channelId string, 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 Routes
- type Server
- type ShrugProvider
- type SlackChannel
- 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) InitBasic() *TestHelper
- func (me *TestHelper) InitSystemAdmin() *TestHelper
- func (me *TestHelper) LoginBasic()
- func (me *TestHelper) LoginBasic2()
- func (me *TestHelper) LoginSystemAdmin()
- type WebConn
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 ( EXPORT_PATH = "export/" EXPORT_FILENAME = "MattermostExport.zip" EXPORT_OPTIONS_FILE = "options.json" EXPORT_TEAMS_FOLDER = "teams" EXPORT_CHANNELS_FOLDER = "channels" EXPORT_CHANNEL_MEMBERS_FOLDER = "members" EXPORT_POSTS_FOLDER = "posts" EXPORT_USERS_FOLDER = "users" EXPORT_LOCAL_STORAGE_FOLDER = "files" )
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 ( WRITE_WAIT = 10 * time.Second PONG_WAIT = 60 * time.Second PING_PERIOD = (PONG_WAIT * 9) / 10 MAX_SIZE = 512 REDIS_WAIT = 60 * time.Second )
View Source
const (
CMD_ECHO = "echo"
)
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_SHRUG = "shrug"
)
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 AddUserToChannel ¶ added in v1.1.0
func ApiAdminSystemRequired ¶
func ApiAppHandler ¶
func ApiUserRequired ¶
func ApiUserRequiredActivity ¶
func AppHandler ¶
func AppHandlerIndependent ¶
func AuthorizeOAuthUser ¶
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 CreateDefaultChannels ¶
func CreateDirectChannel ¶
func CreateOAuthUser ¶ added in v1.4.0
func CreatePost ¶
func CreateWebhookPost ¶ added in v1.2.1
func DeactivateMfa ¶
func ExportChannels ¶
func ExportChannels(writer ExportWriter, options *ExportOptions, teamId string) *model.AppError
func ExportLocalStorage ¶
func ExportLocalStorage(writer ExportWriter, options *ExportOptions, teamId string) *model.AppError
func ExportPosts ¶
func ExportPosts(writer ExportWriter, options *ExportOptions, channelId string) *model.AppError
func ExportTeams ¶
func ExportTeams(writer ExportWriter, options *ExportOptions) *model.AppError
func ExportToFile ¶
func ExportToFile(options *ExportOptions) (link string, err *model.AppError)
func ExportToWriter ¶
func ExportToWriter(w io.Writer, options *ExportOptions) *model.AppError
func ExportUsers ¶
func ExportUsers(writer ExportWriter, options *ExportOptions, teamId string) *model.AppError
func FindTeamByName ¶
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 HandleEtag ¶
func ImportPost ¶
func InitChannel ¶
func InitChannel()
func InitCommand ¶
func InitCommand()
func InitLicense ¶
func InitLicense()
func InitPreference ¶ added in v1.2.1
func InitPreference()
func InitWebSocket ¶
func InitWebSocket()
func InitWebhook ¶
func InitWebhook()
func InvalidateCacheForChannel ¶
func InvalidateCacheForChannel(channelId string)
func InvalidateCacheForUser ¶
func InvalidateCacheForUser(userId string)
func InviteMembers ¶
func IsUsernameTaken ¶
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 PostUpdateChannelHeaderMessageAndForget ¶ added in v1.3.0
func PostUserAddRemoveMessageAndForget ¶ added in v1.1.0
func PublishAndForget ¶
func RegisterCommandProvider ¶
func RegisterCommandProvider(newProvider CommandProvider)
func RemoveAllSessionsForUserId ¶
func RemoveAllSessionsForUserId(userId string)
func RemoveLicense ¶
func RemoveUserFromChannel ¶ added in v1.1.0
func RenderWebError ¶
func RevokeAccessToken ¶
func RevokeAllSession ¶
func RevokeSessionById ¶ added in v1.4.0
func SendEmailChangeVerifyEmailAndForget ¶ added in v1.2.1
func SendEphemeralPost ¶
func SendVerifyEmailAndForget ¶ added in v1.2.1
func SlackAddChannels ¶
func SlackAddPosts ¶
func SlackAddUsers ¶
func SlackConvertChannelName ¶
func SlackConvertTimeStamp ¶
func SlackImport ¶
func StartServer ¶
func StartServer()
func StopServer ¶
func StopServer()
func UpdateActive ¶ added in v1.3.0
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 CommandProvider ¶
type CommandProvider interface { GetTrigger() string GetCommand(c *Context) *model.Command DoCommand(c *Context, channelId string, 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) GetSiteURL ¶
func (*Context) GetTeamURL ¶
func (*Context) HasPermissionsToChannel ¶
func (c *Context) HasPermissionsToChannel(sc store.StoreChannel, where string) bool
func (*Context) HasPermissionsToTeam ¶
func (*Context) HasPermissionsToUser ¶
func (*Context) HasSystemAdminPermissions ¶
func (*Context) IsSystemAdmin ¶
func (*Context) IsTeamAdmin ¶
func (*Context) LogAuditWithUserId ¶
func (*Context) RemoveSessionCookie ¶
func (c *Context) RemoveSessionCookie(w http.ResponseWriter, r *http.Request)
func (*Context) SetInvalidParam ¶
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, channelId string, message string) *model.CommandResponse
func (*EchoProvider) GetCommand ¶
func (me *EchoProvider) GetCommand(c *Context) *model.Command
func (*EchoProvider) GetTrigger ¶
func (me *EchoProvider) GetTrigger() string
type ExportOptions ¶
type ExportOptions struct { TeamsToExport []string `json:"teams"` ChannelsToExport []string `json:"channels"` UsersToExport []string `json:"users"` ExportLocalStorage bool `json:"export_local_storage"` }
func ExportOptionsFromJson ¶
func ExportOptionsFromJson(data io.Reader) *ExportOptions
func (*ExportOptions) ToJson ¶
func (options *ExportOptions) ToJson() string
type ImageGetResult ¶
type JoinProvider ¶
type JoinProvider struct { }
func (*JoinProvider) DoCommand ¶
func (me *JoinProvider) DoCommand(c *Context, channelId string, 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, channelId string, 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, channelId string, 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, channelId string, message string) *model.CommandResponse
func (*MeProvider) GetCommand ¶
func (me *MeProvider) GetCommand(c *Context) *model.Command
func (*MeProvider) GetTrigger ¶
func (me *MeProvider) 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' Files *mux.Router // 'api/v3/teams/{team_id:[A-Za-z0-9]+}/files' OAuth *mux.Router // 'api/v3/oauth' Admin *mux.Router // 'api/v3/admin' Preferences *mux.Router // 'api/v3/preferences' License *mux.Router // 'api/v3/license' Public *mux.Router // 'api/v3/public' }
var BaseRoutes *Routes
type ShrugProvider ¶
type ShrugProvider struct { }
func (*ShrugProvider) DoCommand ¶
func (me *ShrugProvider) DoCommand(c *Context, channelId string, message string) *model.CommandResponse
func (*ShrugProvider) GetCommand ¶
func (me *ShrugProvider) GetCommand(c *Context) *model.Command
func (*ShrugProvider) GetTrigger ¶
func (me *ShrugProvider) GetTrigger() string
type SlackChannel ¶
type SlackChannel struct { Id string `json:"id"` Name string `json:"name"` Members []string `json:"members"` Topic map[string]string `json:"topic"` }
func SlackParseChannels ¶
func SlackParseChannels(data io.Reader) []SlackChannel
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 map[string]string `json:"comment"` }
func SlackParsePosts ¶
type SlackUser ¶
type SlackUser struct { Id string `json:"id"` Username string `json:"name"` Profile map[string]string `json:"profile"` }
func SlackParseUsers ¶
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(platformDir string) *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) 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.Message SessionId string UserId string // contains filtered or unexported fields }
func (*WebConn) HasPermissionsToChannel ¶
func (*WebConn) HasPermissionsToTeam ¶
func (*WebConn) InvalidateCache ¶
func (c *WebConn) InvalidateCache()
func (*WebConn) InvalidateCacheForChannel ¶
Source Files ¶
- admin.go
- api.go
- apitestlib.go
- authentication.go
- auto_channels.go
- auto_constants.go
- auto_environment.go
- auto_posts.go
- auto_teams.go
- auto_users.go
- channel.go
- command.go
- command_echo.go
- command_join.go
- command_loadtest.go
- command_logout.go
- command_me.go
- command_msg.go
- command_shrug.go
- context.go
- export.go
- file.go
- import.go
- license.go
- oauth.go
- post.go
- preference.go
- server.go
- slackimport.go
- team.go
- user.go
- web_conn.go
- web_hub.go
- web_socket.go
- webhook.go
Click to show internal directories.
Click to hide internal directories.