Documentation ¶
Index ¶
- func Add(p Plugin)
- func Execute(ctx *context.Context, conn db.Connection, navButtons types.Buttons, ...) *bytes.Buffer
- func ExecuteWithCustomMenu(ctx *context.Context, navButtons types.Buttons, user models.UserModel, ...) *bytes.Buffer
- func ExecuteWithMenu(ctx *context.Context, conn db.Connection, navButtons types.Buttons, ...) *bytes.Buffer
- func Exist(p Plugin) bool
- func GetAll(req remote_server.GetOnlineReq, token string) (Plugins, Page)
- func GetHandler(app *context.App) context.HandlerMap
- type Base
- func (b *Base) ExecuteTmpl(ctx *context.Context, panel types.Panel, options template.ExecuteOptions) *bytes.Buffer
- func (b *Base) ExecuteTmplWithCustomMenu(ctx *context.Context, panel types.Panel, menu *menu.Menu, ...) *bytes.Buffer
- func (b *Base) ExecuteTmplWithMenu(ctx *context.Context, panel types.Panel, options template.ExecuteOptions) *bytes.Buffer
- func (b *Base) ExecuteTmplWithMenuAndNavButtons(ctx *context.Context, panel types.Panel, menu *menu.Menu, btns types.Buttons, ...) *bytes.Buffer
- func (b *Base) ExecuteTmplWithNavButtons(ctx *context.Context, panel types.Panel, btns types.Buttons, ...) *bytes.Buffer
- func (b *Base) GetGenerators() table.GeneratorList
- func (b *Base) GetHandler() context.HandlerMap
- func (b *Base) GetIndexURL() string
- func (b *Base) GetInfo() Info
- func (b *Base) GetSettingPage() table.Generator
- func (b *Base) HTML(ctx *context.Context, panel types.Panel, options ...template.ExecuteOptions)
- func (b *Base) HTMLBtns(ctx *context.Context, panel types.Panel, btns types.Buttons, ...)
- func (b *Base) HTMLCustomMenu(ctx *context.Context, panel types.Panel, menu *menu.Menu, ...)
- func (b *Base) HTMLFile(ctx *context.Context, path string, data map[string]interface{}, ...)
- func (b *Base) HTMLFiles(ctx *context.Context, data map[string]interface{}, files []string, ...)
- func (b *Base) HTMLMenu(ctx *context.Context, panel types.Panel, options ...template.ExecuteOptions)
- func (b *Base) HTMLMenuWithBtns(ctx *context.Context, panel types.Panel, menu *menu.Menu, btns types.Buttons, ...)
- func (b *Base) InitBase(srv service.List, prefix string)
- func (b *Base) InitPlugin(services service.List)
- func (b *Base) IsInstalled() bool
- func (b *Base) Name() string
- func (b *Base) NewMenu(data menu.NewMenuData) (int64, error)
- func (b *Base) Prefix() string
- func (b *Base) SetInfo(info Info)
- func (b *Base) Title() string
- func (b *Base) Uninstall() error
- func (b *Base) Upgrade() error
- type BasePlugin
- type GetOnlineRes
- type GetOnlineResData
- type Info
- type Page
- type Plugin
- type Plugins
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecuteWithCustomMenu ¶ added in v1.3.0
func ExecuteWithMenu ¶ added in v1.3.0
func GetAll ¶ added in v1.3.0
func GetAll(req remote_server.GetOnlineReq, token string) (Plugins, Page)
func GetHandler ¶
func GetHandler(app *context.App) context.HandlerMap
GetHandler is a help method for Plugin GetHandler.
Types ¶
type Base ¶ added in v1.3.0
type Base struct { App *context.App Services service.List Conn db.Connection UI *ui.Service PlugName string URLPrefix string Info Info }
func (*Base) ExecuteTmpl ¶ added in v1.3.0
func (*Base) ExecuteTmplWithCustomMenu ¶ added in v1.3.0
func (*Base) ExecuteTmplWithMenu ¶ added in v1.3.0
func (*Base) ExecuteTmplWithMenuAndNavButtons ¶ added in v1.3.0
func (*Base) ExecuteTmplWithNavButtons ¶ added in v1.3.0
func (*Base) GetGenerators ¶ added in v1.3.0
func (b *Base) GetGenerators() table.GeneratorList
func (*Base) GetHandler ¶ added in v1.3.0
func (b *Base) GetHandler() context.HandlerMap
func (*Base) GetIndexURL ¶ added in v1.3.0
func (*Base) GetSettingPage ¶ added in v1.3.0
func (*Base) HTMLCustomMenu ¶ added in v1.3.0
func (*Base) HTMLMenuWithBtns ¶ added in v1.3.0
func (*Base) InitPlugin ¶ added in v1.3.0
func (*Base) IsInstalled ¶ added in v1.3.0
type BasePlugin ¶ added in v1.3.0
func (*BasePlugin) GetIndexURL ¶ added in v1.3.0
func (b *BasePlugin) GetIndexURL() string
func (*BasePlugin) GetInfo ¶ added in v1.3.0
func (b *BasePlugin) GetInfo() Info
func (*BasePlugin) IsInstalled ¶ added in v1.3.0
func (b *BasePlugin) IsInstalled() bool
func (*BasePlugin) Name ¶ added in v1.3.0
func (b *BasePlugin) Name() string
type GetOnlineRes ¶ added in v1.3.0
type GetOnlineRes struct { Code int `json:"code"` Msg string `json:"msg"` Data GetOnlineResData `json:"data"` }
type GetOnlineResData ¶ added in v1.3.0
type Info ¶ added in v1.3.0
type Info struct { Title string `json:"title" yaml:"title" ini:"title"` Description string `json:"description" yaml:"description" ini:"description"` OldVersion string `json:"old_version" yaml:"old_version" ini:"old_version"` Version string `json:"version" yaml:"version" ini:"version"` Author string `json:"author" yaml:"author" ini:"author"` Banners []string `json:"banners" yaml:"banners" ini:"banners"` Url string `json:"url" yaml:"url" ini:"url"` Cover string `json:"cover" yaml:"cover" ini:"cover"` MiniCover string `json:"mini_cover" yaml:"mini_cover" ini:"mini_cover"` Website string `json:"website" yaml:"website" ini:"website"` Agreement string `json:"agreement" yaml:"agreement" ini:"agreement"` CreateDate time.Time `json:"create_date" yaml:"create_date" ini:"create_date"` UpdateDate time.Time `json:"update_date" yaml:"update_date" ini:"update_date"` ModulePath string `json:"module_path" yaml:"module_path" ini:"module_path"` Name string `json:"name" yaml:"name" ini:"name"` Uuid string `json:"uuid" yaml:"uuid" ini:"uuid"` Downloaded bool `json:"downloaded" yaml:"downloaded" ini:"downloaded"` ExtraDownloadUrl string `json:"extra_download_url" yaml:"extra_download_url" ini:"extra_download_url"` Price []string `json:"price" yaml:"price" ini:"price"` GoodUUIDs []string `json:"good_uuids" yaml:"good_uuids" ini:"good_uuids"` GoodNum int64 `json:"good_num" yaml:"good_num" ini:"good_num"` CommentNum int64 `json:"comment_num" yaml:"comment_num" ini:"comment_num"` Order int64 `json:"order" yaml:"order" ini:"order"` Features string `json:"features" yaml:"features" ini:"features"` Questions []string `json:"questions" yaml:"questions" ini:"questions"` HasBought bool `json:"has_bought" yaml:"has_bought" ini:"has_bought"` CanUpdate bool `json:"can_update" yaml:"can_update" ini:"can_update"` Legal bool `json:"legal" yaml:"legal" ini:"legal"` SkipInstallation bool `json:"skip_installation" yaml:"skip_installation" ini:"skip_installation"` }
type Plugin ¶
type Plugin interface { GetHandler() context.HandlerMap InitPlugin(services service.List) GetGenerators() table.GeneratorList Name() string Prefix() string GetInfo() Info GetIndexURL() string GetSettingPage() table.Generator IsInstalled() bool Uninstall() error Upgrade() error }
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 FindByName ¶ added in v1.3.0
func FindByNameAll ¶ added in v1.3.0
func LoadFromPlugin ¶ added in v1.3.0
func NewBasePluginWithInfo ¶ added in v1.3.0
Click to show internal directories.
Click to hide internal directories.