A webmail client. Forked from https://git.sr.ht/~migadu/alps
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

25 lines
681 B

  1. package koushin
  2. import (
  3. "html/template"
  4. "github.com/labstack/echo/v4"
  5. )
  6. const pluginDir = "plugins"
  7. // Plugin extends koushin with additional functionality.
  8. type Plugin interface {
  9. // Name should return the plugin name.
  10. Name() string
  11. // LoadTemplate populates t with the plugin's functions and templates.
  12. LoadTemplate(t *template.Template) error
  13. // SetRoutes populates group with the plugin's routes.
  14. SetRoutes(group *echo.Group)
  15. // Inject is called prior to rendering a template. It can extend the
  16. // template data by setting new items in the Extra map.
  17. Inject(name string, data interface{}) error
  18. // Close is called when the plugin is unloaded.
  19. Close() error
  20. }