Documentation ¶
Index ¶
- func AddCronJob(spec string, job func())
- type App
- func (app *App) Bootstrap() *App
- func (app *App) BootstrapWith(mounters ...ComponentMount) *App
- func (app *App) RegisterRouter(f ...func(r *gin.Engine)) *App
- func (app *App) Run() (err error)
- func (app *App) SetGin(gin *gin.Engine) *App
- func (app *App) Use(middlewares ...gin.HandlerFunc) *App
- func (app *App) WaitGracefulExit(srv *http.Server)
- type ComponentMount
- type JobItem
- type Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCronJob ¶ added in v1.1.0
func AddCronJob(spec string, job func())
AddCronJob use for add job
Types ¶
type App ¶
type App struct { *Options Gin *gin.Engine Config *config.Config Logger *logrus.Logger Middlewares []gin.HandlerFunc Components []string ComponentMounters []ComponentMount RouterRegisters []func(r *gin.Engine) Once sync.Once }
App struct
func (*App) BootstrapWith ¶
func (app *App) BootstrapWith(mounters ...ComponentMount) *App
BootstrapWith use for register component
func (*App) RegisterRouter ¶
RegisterRouter use for register router
func (*App) Use ¶
func (app *App) Use(middlewares ...gin.HandlerFunc) *App
Use for add global middleware
func (*App) WaitGracefulExit ¶
WaitGracefulExit graceful exit
type ComponentMount ¶
ComponentMount use for mount component interface
Click to show internal directories.
Click to hide internal directories.