forked from ochinchina/supervisord
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebgui.go
More file actions
25 lines (20 loc) · 660 Bytes
/
webgui.go
File metadata and controls
25 lines (20 loc) · 660 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package main
import (
"net/http"
"github.com/gorilla/mux"
)
// SupervisorWebgui the interface to show a WEBGUI to control the supervisor
type SupervisorWebgui struct {
router *mux.Router
supervisor *Supervisor
}
// NewSupervisorWebgui create a new SupervisorWebgui object
func NewSupervisorWebgui(supervisor *Supervisor) *SupervisorWebgui {
router := mux.NewRouter()
return &SupervisorWebgui{router: router, supervisor: supervisor}
}
// CreateHandler create a http handler to process the request from WEBGUI
func (sw *SupervisorWebgui) CreateHandler() http.Handler {
sw.router.PathPrefix("/").Handler(http.FileServer(HTTP))
return sw.router
}