Documentation
¶
Overview ¶
Package app 核心功能的实现
Index ¶
- type App
- func (app *App) Close() error
- func (app *App) Debug() bool
- func (app *App) Handler() (http.Handler, error)
- func (app *App) InitModules(tag string) error
- func (app *App) Modules() []*module.Module
- func (app *App) Mux() *mux.Mux
- func (app *App) NewModule(name, desc string, deps ...string) *module.Module
- func (app *App) RegisterOnShutdown(f func())
- func (app *App) Serve() error
- func (app *App) SetMiddleware(m middleware.Middleware) *App
- func (app *App) Shutdown() error
- func (app *App) URL(path string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App 程序运行实例
func (*App) InitModules ¶ added in v0.16.1
InitModules 执行模板的初始化函数。可以重复调用执行。
func (*App) RegisterOnShutdown ¶ added in v0.16.1
func (app *App) RegisterOnShutdown(f func())
RegisterOnShutdown 等于于 http.Server.RegisterOnShutdown
func (*App) SetMiddleware ¶
func (app *App) SetMiddleware(m middleware.Middleware) *App
SetMiddleware 设置一个全局的中间件,多次设置,只有最后一次会启作用。
Directories
¶
| Path | Synopsis |
|---|---|
|
Package middlewares 提供一系列中间
|
Package middlewares 提供一系列中间 |
|
Package modules 处理模块信息
|
Package modules 处理模块信息 |
|
Package webconfig web.yaml 配置文件对应的内容。
|
Package webconfig web.yaml 配置文件对应的内容。 |
Click to show internal directories.
Click to hide internal directories.