-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbase.go
50 lines (40 loc) · 1.16 KB
/
base.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
39
40
41
42
43
44
45
46
47
48
49
50
package ambient
import (
"html/template"
"net/http"
)
// PluginBase represents a base plugin that works with Ambient.
type PluginBase struct {
*Toolkit
}
// Enable is to enable the plugin. Toolkit should be saved.
func (p *PluginBase) Enable(toolkit *Toolkit) error {
p.Toolkit = toolkit
return nil
}
// Disable is to disable the plugin.
func (p *PluginBase) Disable() error {
return nil
}
// Routes sets routes for the plugin.
func (p *PluginBase) Routes() {}
// Assets returns a list of assets and an embedded filesystem.
func (p *PluginBase) Assets() ([]Asset, FileSystemReader) {
return nil, nil
}
// FuncMap returns a callable function that accepts a request.
func (p *PluginBase) FuncMap() func(r *http.Request) template.FuncMap {
return nil
}
// Settings returns a list of user settable fields.
func (p *PluginBase) Settings() []Setting {
return nil
}
// GrantRequests returns a list of grants requested by the plugin.
func (p *PluginBase) GrantRequests() []GrantRequest {
return nil
}
// Middleware returns a list of middleware.
func (p *PluginBase) Middleware() []func(next http.Handler) http.Handler {
return []func(next http.Handler) http.Handler{}
}