web

package
v5.11.1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2019 License: AGPL-3.0, Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PAGE_DEFAULT          = 0
	PER_PAGE_DEFAULT      = 60
	PER_PAGE_MAXIMUM      = 200
	LOGS_PER_PAGE_DEFAULT = 10000
	LOGS_PER_PAGE_MAXIMUM = 10000
)

Variables

This section is empty.

Functions

func CheckClientCompatability

func CheckClientCompatability(agentString string) bool

func Handle404

func Handle404(config configservice.ConfigService, w http.ResponseWriter, r *http.Request)

func IsApiCall

func IsApiCall(config configservice.ConfigService, r *http.Request) bool

func IsWebhookCall

func IsWebhookCall(a *app.App, r *http.Request) bool

func NewInvalidParamError

func NewInvalidParamError(parameter string) *model.AppError

func NewInvalidUrlParamError

func NewInvalidUrlParamError(parameter string) *model.AppError

func ReturnStatusOK

func ReturnStatusOK(w http.ResponseWriter)

Types

type Context

type Context struct {
	App    *app.App
	Log    *mlog.Logger
	Params *Params
	Err    *model.AppError
	// contains filtered or unexported fields
}

func (*Context) GetSiteURLHeader

func (c *Context) GetSiteURLHeader() string

func (*Context) HandleEtag

func (c *Context) HandleEtag(etag string, routeName string, w http.ResponseWriter, r *http.Request) bool

func (*Context) IsSystemAdmin

func (c *Context) IsSystemAdmin() bool

func (*Context) LogAudit

func (c *Context) LogAudit(extraInfo string)

func (*Context) LogAuditWithUserId

func (c *Context) LogAuditWithUserId(userId, extraInfo string)

func (*Context) LogDebug

func (c *Context) LogDebug(err *model.AppError)

func (*Context) LogError

func (c *Context) LogError(err *model.AppError)

func (*Context) LogInfo

func (c *Context) LogInfo(err *model.AppError)

func (*Context) MfaRequired

func (c *Context) MfaRequired()

func (*Context) RemoveSessionCookie

func (c *Context) RemoveSessionCookie(w http.ResponseWriter, r *http.Request)

func (*Context) RequireActionId

func (c *Context) RequireActionId() *Context

func (*Context) RequireAppId

func (c *Context) RequireAppId() *Context

func (*Context) RequireBotUserId

func (c *Context) RequireBotUserId() *Context

func (*Context) RequireCategory

func (c *Context) RequireCategory() *Context

func (*Context) RequireChannelId

func (c *Context) RequireChannelId() *Context

func (*Context) RequireChannelName

func (c *Context) RequireChannelName() *Context

func (*Context) RequireCommandId

func (c *Context) RequireCommandId() *Context

func (*Context) RequireEmail

func (c *Context) RequireEmail() *Context

func (*Context) RequireEmojiId

func (c *Context) RequireEmojiId() *Context

func (*Context) RequireEmojiName

func (c *Context) RequireEmojiName() *Context

func (*Context) RequireFileId

func (c *Context) RequireFileId() *Context

func (*Context) RequireFilename

func (c *Context) RequireFilename() *Context

func (*Context) RequireGroupId

func (c *Context) RequireGroupId() *Context

func (*Context) RequireHookId

func (c *Context) RequireHookId() *Context

func (*Context) RequireInviteId

func (c *Context) RequireInviteId() *Context

func (*Context) RequireJobId

func (c *Context) RequireJobId() *Context

func (*Context) RequireJobType

func (c *Context) RequireJobType() *Context

func (*Context) RequirePluginId

func (c *Context) RequirePluginId() *Context

func (*Context) RequirePostId

func (c *Context) RequirePostId() *Context

func (*Context) RequirePreferenceName

func (c *Context) RequirePreferenceName() *Context

func (*Context) RequireRemoteId

func (c *Context) RequireRemoteId() *Context

func (*Context) RequireReportId

func (c *Context) RequireReportId() *Context

func (*Context) RequireRoleId

func (c *Context) RequireRoleId() *Context

func (*Context) RequireRoleName

func (c *Context) RequireRoleName() *Context

func (*Context) RequireSchemeId

func (c *Context) RequireSchemeId() *Context

func (*Context) RequireService

func (c *Context) RequireService() *Context

func (*Context) RequireSyncableId

func (c *Context) RequireSyncableId() *Context

func (*Context) RequireSyncableType

func (c *Context) RequireSyncableType() *Context

func (*Context) RequireTeamId

func (c *Context) RequireTeamId() *Context

func (*Context) RequireTeamName

func (c *Context) RequireTeamName() *Context

func (*Context) RequireTokenId

func (c *Context) RequireTokenId() *Context

func (*Context) RequireUserId

func (c *Context) RequireUserId() *Context

func (*Context) RequireUsername

func (c *Context) RequireUsername() *Context

func (*Context) SessionRequired

func (c *Context) SessionRequired()

func (*Context) SetInvalidParam

func (c *Context) SetInvalidParam(parameter string)

func (*Context) SetInvalidUrlParam

func (c *Context) SetInvalidUrlParam(parameter string)

func (*Context) SetPermissionError

func (c *Context) SetPermissionError(permission *model.Permission)

func (*Context) SetSiteURLHeader

func (c *Context) SetSiteURLHeader(url string)

type Handler

type Handler struct {
	GetGlobalAppOptions app.AppOptionCreator
	HandleFunc          func(*Context, http.ResponseWriter, *http.Request)
	RequireSession      bool
	TrustRequester      bool
	RequireMfa          bool
	IsStatic            bool
	// contains filtered or unexported fields
}

func (Handler) ServeHTTP

func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Params

type Params struct {
	UserId         string
	TeamId         string
	InviteId       string
	TokenId        string
	ChannelId      string
	PostId         string
	FileId         string
	Filename       string
	PluginId       string
	CommandId      string
	HookId         string
	ReportId       string
	EmojiId        string
	AppId          string
	Email          string
	Username       string
	TeamName       string
	ChannelName    string
	PreferenceName string
	EmojiName      string
	Category       string
	Service        string
	JobId          string
	JobType        string
	ActionId       string
	RoleId         string
	RoleName       string
	SchemeId       string
	Scope          string
	GroupId        string
	Page           int
	PerPage        int
	LogsPerPage    int
	Permanent      bool
	RemoteId       string
	SyncableId     string
	SyncableType   model.GroupSyncableType
	BotUserId      string
	Q              string
	IsLinked       *bool
	IsConfigured   *bool
}

func ParamsFromRequest

func ParamsFromRequest(r *http.Request) *Params

type Web

type Web struct {
	GetGlobalAppOptions app.AppOptionCreator
	ConfigService       configservice.ConfigService
	MainRouter          *mux.Router
}

func New

func New(config configservice.ConfigService, globalOptions app.AppOptionCreator, root *mux.Router) *Web

func (*Web) InitSaml

func (w *Web) InitSaml()

func (*Web) InitStatic

func (w *Web) InitStatic()

func (*Web) InitWebhooks

func (w *Web) InitWebhooks()

func (*Web) NewHandler

func (w *Web) NewHandler(h func(*Context, http.ResponseWriter, *http.Request)) http.Handler

func (*Web) NewStaticHandler

func (w *Web) NewStaticHandler(h func(*Context, http.ResponseWriter, *http.Request)) http.Handler

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL