statping/dev/plugin/main.go

41 lines
682 B
Go
Raw Normal View History

2018-10-08 10:06:25 +00:00
package main
import (
2018-12-04 04:17:29 +00:00
"github.com/hunterlong/statping/types"
2018-10-11 00:43:23 +00:00
"net/http"
2018-10-08 10:06:25 +00:00
)
2018-10-11 00:43:23 +00:00
type PluginObj types.PluginInfo
2018-10-08 10:06:25 +00:00
2018-10-11 00:43:23 +00:00
var Plugin = PluginObj{
Info: &types.Info{
Name: "Example Plugin",
2018-12-04 05:57:11 +00:00
Description: "This is an example plugin for Statping Status Page application. It can be implemented pretty quick!",
2018-10-11 00:43:23 +00:00
},
Routes: []*types.PluginRoute{{
Url: "/setuper",
Method: "GET",
Func: SampleHandler,
}},
}
2018-10-08 10:06:25 +00:00
func main() {
}
2018-10-11 00:43:23 +00:00
func SampleHandler(w http.ResponseWriter, r *http.Request) {
}
func (e *PluginObj) OnLoad() error {
return nil
}
func (e *PluginObj) GetInfo() *types.Info {
return e.Info
}
func (e *PluginObj) Router() []*types.PluginRoute {
return e.Routes
2018-10-08 10:06:25 +00:00
}