plugin

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	context.Context

	Router   *gin.RouterGroup
	Database *gorm.DB
	Cron     *cron.Cron
}

func NewContext

func NewContext(ctx context.Context, router *gin.RouterGroup, database *gorm.DB, cron *cron.Cron) *Context

type Plugin

type Plugin interface {
	Name() string

	// It will be called when the plugin be installed
	Install() error

	// It will be called when the plugin be uninstalled
	Uninstall() error

	// It will be called when the system starts
	Run(c *Context) error

	// It will be called when the system shutdown
	Stop() error
}

func Load

func Load(filename string) (Plugin, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL