Files
server/plugin/example/minimal/main.go
eternal-flame-AD e5b24f4c92 Add plugin feature
Fixed database migration
Added a plugin system based on the go plugin package
2019-02-09 12:52:01 +01:00

36 lines
710 B
Go

package main
import (
"github.com/gotify/plugin-api"
)
// GetGotifyPluginInfo returns gotify plugin info
func GetGotifyPluginInfo() plugin.Info {
return plugin.Info{
Name: "minimal plugin",
ModulePath: "github.com/gotify/server/example/minimal",
}
}
// Plugin is plugin instance
type Plugin struct{}
// Enable implements plugin.Plugin
func (c *Plugin) Enable() error {
return nil
}
// Disable implements plugin.Plugin
func (c *Plugin) Disable() error {
return nil
}
// NewGotifyPluginInstance creates a plugin instance for a user context.
func NewGotifyPluginInstance(ctx plugin.UserContext) plugin.Plugin {
return &Plugin{}
}
func main() {
panic("this should be built as go plugin")
}