plugin

package
v0.0.0-...-cb11b3e Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(plugin Plugin)

func TriggerLoad

func TriggerLoad(app core.App) (err error)

func TriggerPreload

func TriggerPreload(app core.App) (err error)

func TriggerServe

func TriggerServe(event *core.ServeEvent) (err error)

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder(pluginArgs ...string) (*Builder, error)

func (*Builder) Compile

func (b *Builder) Compile(buildArgs ...string) error

func (*Builder) Run

func (b *Builder) Run(args ...string) error

type Plugin

type Plugin interface {
	/**
	 * Preload is called before the app is setup.
	 * This is a good place to load configurations.
	 */
	OnPreload(app core.App) error

	/**
	 * Load is called after the app is setup.
	 * This is a good place to register commands
	 * and hooks.
	 */
	OnLoad(app core.App) error

	/**
	 * Serve is called after the app starts and
	 * has finished setting up the HTTP server.
	 * This is a good place to register routes.
	 */
	OnServe(event *core.ServeEvent) error

	/**
	 * Get plugin info
	 */
	Info() PluginInfo
}

func GetPlugins

func GetPlugins() []Plugin

type PluginInfo

type PluginInfo struct {
	Name        string
	Version     string
	Description string
}

type PluginModule

type PluginModule struct {
	Module      string
	Version     string
	Replacement string
}

func (PluginModule) String

func (p PluginModule) String() string

Jump to

Keyboard shortcuts

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