Documentation ¶
Index ¶
- Constants
- Variables
- func AddSessionToCache(session *model.Session)
- func ApiAdminSystemRequired(h func(*Context, http.ResponseWriter, *http.Request)) http.Handler
- func ApiAppHandler(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 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, *model.Team, *model.AppError)
- 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(c *Context, otherUserId string) (*model.Channel, *model.AppError)
- func CreatePost(c *Context, post *model.Post, doUpdateLastViewed bool) (*model.Post, *model.AppError)
- func CreateTeam(c *Context, team *model.Team) *model.Team
- func CreateUser(c *Context, team *model.Team, user *model.User) *model.User
- 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(c *Context, name string, all string) bool
- func FireAndForgetVerifyEmail(userId, userEmail, teamName, teamDisplayName, siteURL, teamURL string)
- func GetAuthData(code string) *model.AuthData
- func GetAuthorizationCode(c *Context, w http.ResponseWriter, r *http.Request, ...)
- func GetIpAddress(r *http.Request) string
- func GetProtocol(r *http.Request) string
- 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(user *model.User) *model.User
- func InitAdmin(r *mux.Router)
- func InitApi()
- func InitChannel(r *mux.Router)
- func InitCommand(r *mux.Router)
- func InitFile(r *mux.Router)
- func InitOAuth(r *mux.Router)
- func InitPost(r *mux.Router)
- func InitTeam(r *mux.Router)
- func InitUser(r *mux.Router)
- func InitWebSocket(r *mux.Router)
- func InitWebhook(r *mux.Router)
- func InviteMembers(c *Context, team *model.Team, user *model.User, invites []string)
- func IsBetaDomain(r *http.Request) bool
- func IsPrivateIpAddress(ipAddress string) bool
- func IsTestDomain(r *http.Request) bool
- func IsUsernameTaken(name string, teamId string) bool
- func IsVerifyHashRequired(user *model.User, team *model.Team, hash string) bool
- func JoinChannel(c *Context, channelId string, role string)
- func JoinDefaultChannels(user *model.User, channelRole string) *model.AppError
- func Login(c *Context, w http.ResponseWriter, r *http.Request, user *model.User, ...)
- func LoginByEmail(c *Context, w http.ResponseWriter, r *http.Request, ...) *model.User
- func LoginById(c *Context, w http.ResponseWriter, r *http.Request, ...) *model.User
- func Logout(c *Context, w http.ResponseWriter, r *http.Request)
- func NewServer()
- func PublishAndForget(message *model.Message)
- func RenderWebError(err *model.AppError, w http.ResponseWriter, r *http.Request)
- func RevokeAccessToken(token string) *model.AppError
- func RevokeAllSession(c *Context, userId 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 UpdateChannelAccessCacheAndForget(teamId, userId, channelId string)
- func UpdateRoles(c *Context, user *model.User, roles string) *model.User
- func UserRequired(h func(*Context, http.ResponseWriter, *http.Request)) http.Handler
- type AutoChannelCreator
- type AutoPostCreator
- type AutoTeamCreator
- type AutoUserCreator
- 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)
- func (c *Context) SetInvalidParam(where string, name string)
- func (c *Context) SetUnknownError(where string, details string)
- func (c *Context) SystemAdminRequired()
- func (c *Context) UserRequired()
- type ExportOptions
- type ExportWriter
- type Hub
- type ImageGetResult
- type Page
- type Server
- type ServerTemplatePage
- type SlackChannel
- type SlackPost
- type SlackUser
- type TeamEnviroment
- type TeamHub
- type TestEnviroment
- 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 )
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"} )
View Source
var ServerTemplates *template.Template
Functions ¶
func AddSessionToCache ¶
func ApiAdminSystemRequired ¶
func ApiAppHandler ¶
func ApiUserRequired ¶
func ApiUserRequiredActivity ¶
func AppHandler ¶
func AppHandlerIndependent ¶
func AuthorizeOAuthUser ¶
func CreateBasicUser ¶
Basic test team and user so you always know one
func CreateChannel ¶
func CreateDefaultChannels ¶
func CreateDirectChannel ¶
func CreatePost ¶
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 FireAndForgetVerifyEmail ¶
func FireAndForgetVerifyEmail(userId, userEmail, teamName, teamDisplayName, siteURL, teamURL string)
func GetAuthData ¶
func GetAuthorizationCode ¶
func GetIpAddress ¶
func GetProtocol ¶
func HandleEtag ¶
func ImportPost ¶
func InitChannel ¶
func InitCommand ¶
func InitWebSocket ¶
func InitWebhook ¶
func InviteMembers ¶
func IsBetaDomain ¶
func IsPrivateIpAddress ¶
func IsTestDomain ¶
func IsUsernameTaken ¶
func IsVerifyHashRequired ¶
func JoinChannel ¶
func JoinDefaultChannels ¶
func LoginByEmail ¶
func PublishAndForget ¶
func RenderWebError ¶
func RevokeAccessToken ¶
func RevokeAllSession ¶
func SlackAddChannels ¶
func SlackAddPosts ¶
func SlackAddUsers ¶
func SlackConvertChannelName ¶
func SlackConvertTimeStamp ¶
func SlackImport ¶
func StartServer ¶
func StartServer()
func StopServer ¶
func StopServer()
func UpdateChannelAccessCacheAndForget ¶
func UpdateChannelAccessCacheAndForget(teamId, userId, channelId string)
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, teamID string) *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, teamID string) *AutoUserCreator
func (*AutoUserCreator) CreateTestUsers ¶
type Context ¶
type Context struct { Session model.Session RequestId string IpAddress string Path string Err *model.AppError // 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)
func (*Context) SetInvalidParam ¶
func (*Context) SetUnknownError ¶
func (*Context) SystemAdminRequired ¶
func (c *Context) SystemAdminRequired()
func (*Context) UserRequired ¶
func (c *Context) UserRequired()
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 ServerTemplatePage ¶
type ServerTemplatePage Page
func NewServerTemplatePage ¶
func NewServerTemplatePage(templateName string) *ServerTemplatePage
func (*ServerTemplatePage) Render ¶
func (me *ServerTemplatePage) Render() 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 TeamEnviroment ¶
type TeamHub ¶
type TeamHub struct {
// contains filtered or unexported fields
}
func NewTeamHub ¶
func (*TeamHub) Unregister ¶
func (*TeamHub) UpdateChannelAccessCache ¶
type TestEnviroment ¶
type TestEnviroment struct { Teams []*model.Team Enviroments []TeamEnviroment }
Source Files ¶
- admin.go
- api.go
- auto_channels.go
- auto_constants.go
- auto_enviroment.go
- auto_posts.go
- auto_teams.go
- auto_users.go
- channel.go
- command.go
- context.go
- export.go
- file.go
- import.go
- oauth.go
- post.go
- server.go
- sharding.go
- slackimport.go
- team.go
- user.go
- web_conn.go
- web_hub.go
- web_socket.go
- web_team_hub.go
- webhook.go
Click to show internal directories.
Click to hide internal directories.