mirror of
https://github.com/donl/gPanel.git
synced 2026-06-03 06:12:24 -06:00
22 lines
614 B
Go
22 lines
614 B
Go
// Package server is a child of package api to handle api calls concerning the server
|
|
package server
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/Ennovar/gPanel/pkg/public"
|
|
)
|
|
|
|
// Maintenance function is called from /api/server/maintenance and will place the public server into
|
|
// maintenance mode.
|
|
func Maintenance(res http.ResponseWriter, req *http.Request, publicServer *public.Controller) bool {
|
|
if req.Method != "UPDATE" {
|
|
http.Error(res, http.StatusText(http.StatusMethodNotAllowed), http.StatusMethodNotAllowed)
|
|
return false
|
|
}
|
|
|
|
publicServer.Maintenance()
|
|
res.WriteHeader(http.StatusNoContent)
|
|
|
|
return true
|
|
}
|