MCPcopy
hub / github.com/gotify/server / Enable

Method Enable

plugin/example/clock/main.go:27–38  ·  view source on GitHub ↗

Enable implements plugin.Plugin

()

Source from the content-addressed store, hash-verified

25
26// Enable implements plugin.Plugin
27func (c *Plugin) Enable() error {
28 c.enabled = true
29 c.cronHandler = cron.New()
30 c.cronHandler.AddFunc("0 0 * * *", func() {
31 c.msgHandler.SendMessage(plugin.Message{
32 Title: "Tick Tock!",
33 Message: time.Now().Format("It is 15:04:05 now."),
34 })
35 })
36 c.cronHandler.Start()
37 return nil
38}
39
40// Disable implements plugin.Plugin
41func (c *Plugin) Disable() error {

Callers

nothing calls this directly

Calls 1

SendMessageMethod · 0.65

Tested by

no test coverage detected