module

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: AGPL-3.0 Imports: 19 Imported by: 26

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NgingPluginDir = `vendor/github.com/nging-plugins` // `../../nging-plugins`
View Source
var WebCoreDir = `vendor/github.com/coscms/webcore`

Functions

func Register

func Register(modules ...IModule)

func SetAssets

func SetAssets(backendSo *middleware.StaticOptions, frontendSo *middleware.StaticOptions, assetsPath string)

func SetBackendAssets

func SetBackendAssets(assetsPath string)

func SetBackendTemplate

func SetBackendTemplate(key string, templatePath string)

func SetTemplate

func SetTemplate(backendPa *ntemplate.PathAliases, frontendPa *ntemplate.PathAliases, key string, templatePath string)

Types

type Dashboard added in v0.3.0

type Dashboard interface {
	Backend() *dashboard.Dashboard
	Frontend() *dashboard.Dashboard
}

func NewDashboard added in v0.3.0

func NewDashboard() Dashboard

type IModule

type IModule interface {
	Apply()
	Version() float64
}

type Module

type Module struct {
	Startup       string                      // 默认启动项(多个用半角逗号“,”隔开)
	Navigate      func(Navigate)              // 注册导航菜单
	Extend        map[string]extend.Initer    // 注册扩展配置项
	Cmder         map[string]cmder.Cmder      // 注册命令
	TemplatePath  map[string]string           // 注册模板路径
	AssetsPath    []string                    // 注册素材路径
	SQLCollection func(*config.SQLCollection) // 注册SQL语句
	Dashboard     func(Dashboard)             // 注册控制面板首页区块
	Route         func(Router)                // 注册网址路由
	LogParser     map[string]nlog.LogParser   // 注册日志解析器
	Settings      []*settings.SettingForm     // 注册配置选项
	CronJobs      []*cron.Jobx                // 注册定时任务
	DBSchemaVer   float64                     // 设置数据库结构版本号
}

func (*Module) Apply

func (m *Module) Apply()

func (*Module) Version

func (m *Module) Version() float64
type Navigate interface {
	Backend() *navigate.ProjectNavigates
	Frontend() *navigate.ProjectNavigates
}

func NewNavigate added in v0.3.0

func NewNavigate() Navigate

type Router added in v0.3.0

type Router interface {
	Backend() route.IRegister
	Frontend() route.IRegister
}

func NewRouter added in v0.3.0

func NewRouter() Router

Jump to

Keyboard shortcuts

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