-
Notifications
You must be signed in to change notification settings - Fork 942
/
Copy pathplugin.go
38 lines (30 loc) · 886 Bytes
/
plugin.go
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
26
27
28
29
30
31
32
33
34
35
36
37
38
package web
import (
"html/template"
"net/http"
"github.com/jonas747/yagpdb/common"
)
// Plugin represents a web plugin
type Plugin interface {
common.Plugin
// Parse the templates and set up the http routes here
// mainMuxer is the root and cpmuxer handles the /cp/ route
// the cpmuxer requires a session and to be a admin of the server
// being managed, otherwise it will redirect to the homepage
InitWeb()
}
type RenderedServerHomeWidget struct {
Body template.HTML
Title template.HTML
Enabled bool
}
type PluginWithServerHomeWidget interface {
LoadServerHomeWidget(w http.ResponseWriter, r *http.Request) (TemplateData, error)
}
type PluginWithServerHomeWidgetMiddlewares interface {
PluginWithServerHomeWidget
ServerHomeWidgetApplyMiddlewares(inner http.Handler) http.Handler
}
type ServerHomeWidgetWithOrder interface {
ServerHomeWidgetOrder() int
}