Documentation
¶
Overview ¶
Package handlers contains http handlers
Index ¶
- func API() http.Handler
- func APICmd(config configuration.Config) http.Handler
- func APIConnections(config configuration.Config, server data.Server) http.Handler
- func APILogin(config configuration.Config) http.Handler
- func APIUsers(config configuration.Config) http.Handler
- func AccessControlAllow(next http.Handler) http.Handler
- func CastSSE(config configuration.Config) http.Handler
- func Exec() http.Handler
- func Homepage(iframeHandler http.Handler, config configuration.Config) http.Handler
- func IFrame(config configuration.Config) http.Handler
- func Login(loginPage []byte) http.Handler
- func LoginRedirect(w http.ResponseWriter, r *http.Request, origin string)
- func NoLayout(config configuration.Config) http.Handler
- func Options(optionsPage []byte, config configuration.Config) http.Handler
- func SSE(server data.Server, config configuration.Config) http.Handler
- func Stats(statsPage []byte, config configuration.Config) http.Handler
- type RequestPayload
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APIConnections ¶ added in v1.3.0
func AccessControlAllow ¶
AccessControlAllow is a middleware that sets CORS headers on the response. It allows requests from any origin specified in the request's "Origin" header and supports HTTP methods POST, GET, OPTIONS, PUT, and DELETE. It also sets the allowed headers to "Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization". The next handler in the chain is called after setting these headers.
func CastSSE ¶ added in v1.0.3
func CastSSE(config configuration.Config) http.Handler
CastSSE returns an HTTP handler that handles server execution of a commands
func LoginRedirect ¶ added in v1.0.4
func LoginRedirect(w http.ResponseWriter, r *http.Request, origin string)
func Options ¶ added in v1.3.0
func Options(optionsPage []byte, config configuration.Config) http.Handler
func Stats ¶ added in v1.0.4
func Stats(statsPage []byte, config configuration.Config) http.Handler
Stats returns a http.Handler that writes the given statsPage to the response body. The request must have a valid cookie id and either admin privileges or a valid user password to access the page. If the request is unauthenticated, the handler redirects to the login page.