plugins

package
v1.188.9487 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute added in v1.88.9453

func Execute(ctx *context.Context, conn db.Connection, navButtons types.Buttons, user models.UserModel,
	panel types.Panel, animation ...bool) *bytes.Buffer

func GetHandler

func GetHandler(app *context.App) context.HandlerMap

GetHandler is a help method for Plugin GetHandler.

Types

type Base added in v1.88.9453

type Base struct {
	App       *context.App
	Services  service.List
	Conn      db.Connection
	UI        *ui.Service
	PlugName  string
	URLPrefix string
}

func (*Base) ExecuteTmpl added in v1.88.9453

func (b *Base) ExecuteTmpl(ctx *context.Context, panel types.Panel, animation ...bool) *bytes.Buffer

func (*Base) GetHandler added in v1.88.9453

func (b *Base) GetHandler() context.HandlerMap

func (*Base) HTML added in v1.88.9453

func (b *Base) HTML(ctx *context.Context, panel types.Panel, animation ...bool)

func (*Base) HTMLFile added in v1.88.9453

func (b *Base) HTMLFile(ctx *context.Context, path string, data map[string]interface{}, animation ...bool)

func (*Base) HTMLFiles added in v1.88.9453

func (b *Base) HTMLFiles(ctx *context.Context, data map[string]interface{}, files []string, animation ...bool)

func (*Base) InitBase added in v1.88.9453

func (b *Base) InitBase(srv service.List)

func (*Base) Name added in v1.88.9453

func (b *Base) Name() string

func (*Base) Prefix added in v1.88.9453

func (b *Base) Prefix() string

type Plugin

type Plugin interface {
	GetHandler() context.HandlerMap // 返回路由和控制器方法
	InitPlugin(services service.List)
	Name() string
	Prefix() string
}

Plugin as one of the key components of goAdmin has three methods. GetRequest return all the path registered in the plugin. GetHandler according the url and method return the corresponding handler. InitPlugin init the plugin which do something like init the database and set the config and register the routes. The Plugin must implement the three methods.

func LoadFromPlugin added in v1.88.9453

func LoadFromPlugin(mod string) Plugin

Jump to

Keyboard shortcuts

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