Documentation ¶
Index ¶
- Constants
- Variables
- 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 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 CanManageChannel(c *Context, channel *model.Channel) bool
- func GenerateTestEmail() string
- func GenerateTestTeamName() string
- func GetAllTeamListings(c *Context, w http.ResponseWriter, r *http.Request)
- func Handle404(w http.ResponseWriter, r *http.Request)
- func HandleEtag(etag string, routeName string, w http.ResponseWriter, r *http.Request) bool
- func InitAdmin()
- func InitApi()
- func InitChannel()
- func InitCommand()
- func InitDeprecated()
- func InitEmoji()
- func InitFile()
- func InitGeneral()
- func InitLicense()
- func InitOAuth()
- func InitPost()
- func InitPreference()
- func InitReaction()
- func InitRouter()
- func InitStatus()
- func InitTeam()
- func InitUser()
- func InitWebSocket()
- func InitWebhook()
- func InitWebrtc()
- func IsApiCall(r *http.Request) bool
- func LinkUserToTeam(user *model.User, team *model.Team)
- 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 NewInvalidParamError(where string, name string) *model.AppError
- func ReloadConfigForSetup()
- func ReturnStatusOK(w http.ResponseWriter)
- func TearDown()
- 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
- type Context
- func (c *Context) CheckTeamId()
- func (c *Context) GetCurrentTeamMember() *model.TeamMember
- func (c *Context) GetSiteURLHeader() string
- func (c *Context) GetTeamURL() string
- func (c *Context) GetTeamURLFromTeam(team *model.Team) string
- func (c *Context) IsSystemAdmin() bool
- 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) SetPermissionError(permission *model.Permission)
- 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 Routes
- type TestHelper
- func (me *TestHelper) CreateChannel(client *model.Client, team *model.Team) *model.Channel
- func (me *TestHelper) CreateClient() *model.Client
- func (me *TestHelper) CreatePinnedPost(client *model.Client, channel *model.Channel) *model.Post
- 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()
Constants ¶
View Source
const ( PREVIEW_IMAGE_TYPE = "image/jpeg" THUMBNAIL_IMAGE_TYPE = "image/jpeg" )
View Source
const OPEN_GRAPH_METADATA_CACHE_SIZE = 10000
Variables ¶
View Source
var UNSAFE_CONTENT_TYPES = [...]string{
"application/javascript",
"application/ecmascript",
"text/javascript",
"text/ecmascript",
"application/x-javascript",
"text/html",
}
Functions ¶
func ApiAdminSystemRequired ¶
func ApiAppHandler ¶
func ApiUserRequired ¶
func ApiUserRequiredActivity ¶
func ApiUserRequiredMfa ¶
func AppHandler ¶
func AppHandlerIndependent ¶
func GenerateTestEmail ¶
func GenerateTestEmail() string
func GenerateTestTeamName ¶
func GenerateTestTeamName() string
func GetAllTeamListings ¶
func GetAllTeamListings(c *Context, w http.ResponseWriter, r *http.Request)
func HandleEtag ¶
func InitChannel ¶
func InitChannel()
func InitCommand ¶
func InitCommand()
func InitDeprecated ¶
func InitDeprecated()
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 InitWebSocket ¶
func InitWebSocket()
func InitWebhook ¶
func InitWebhook()
func InitWebrtc ¶
func InitWebrtc()
func ReloadConfigForSetup ¶
func ReloadConfigForSetup()
func ReturnStatusOK ¶
func ReturnStatusOK(w http.ResponseWriter)
func UserRequired ¶
Types ¶
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) GetSiteURLHeader ¶
func (*Context) GetTeamURL ¶
func (*Context) GetTeamURLFromTeam ¶
TODO see where these are used
func (*Context) IsSystemAdmin ¶
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) SetPermissionError ¶
func (c *Context) SetPermissionError(permission *model.Permission)
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 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' }
var BaseRoutes *Routes
type TestHelper ¶
type TestHelper struct { BasicClient *model.Client BasicTeam *model.Team BasicUser *model.User BasicUser2 *model.User BasicChannel *model.Channel BasicPost *model.Post PinnedPost *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) CreatePinnedPost ¶
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()
Click to show internal directories.
Click to hide internal directories.