api

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MediaContentTypes = [...]string{
	"image/jpeg",
	"image/png",
	"image/bmp",
	"image/gif",
	"image/tiff",
	"image/webp",
	"video/avi",
	"video/mpeg",
	"video/mp4",
	"audio/mpeg",
	"audio/wav",
}
View Source
var UnsafeContentTypes = [...]string{
	"application/javascript",
	"application/ecmascript",
	"text/javascript",
	"text/ecmascript",
	"application/x-javascript",
	"text/html",
}

Functions

func ReturnStatusOK

func ReturnStatusOK(w http.ResponseWriter)

func WriteFileResponse

func WriteFileResponse(filename string, contentType string, contentSize int64, lastModification time.Time, webserverMode string, fileReader io.ReadSeeker, forceDownload bool, w http.ResponseWriter, r *http.Request)

WriteFileResponse is copied from Mattermost server https://github.com/mattermost/mattermost/blob/f0121d4f23e065a05e63fd452486570271c6a28f/server/platform/shared/web/files.go#L38

Types

type Handlers

type Handlers struct {
	Router *mux.Router
	// contains filtered or unexported fields
}

func New

func New(app *app.UserSurveyApp, pluginAPI plugin.API) *Handlers

func (*Handlers) DisallowGuestUsers

func (api *Handlers) DisallowGuestUsers(w http.ResponseWriter, r *http.Request) error

func (*Handlers) RequireAuthentication

func (api *Handlers) RequireAuthentication(w http.ResponseWriter, r *http.Request) error

func (*Handlers) RequireSurveySentToUser

func (api *Handlers) RequireSurveySentToUser(w http.ResponseWriter, r *http.Request, surveyID string) error

func (*Handlers) RequireSystemAdmin

func (api *Handlers) RequireSystemAdmin(w http.ResponseWriter, r *http.Request) error

Jump to

Keyboard shortcuts

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