Documentation ¶
Index ¶
- Variables
- type Bootstrapper
- func (b *Bootstrapper) Bootstrap() *Bootstrapper
- func (b *Bootstrapper) Configure(cs ...Configurator)
- func (b *Bootstrapper) Listen(addr string, cfgs ...iris.Configurator)
- func (b *Bootstrapper) ListenSock(l net.Listener, cfgs ...iris.Configurator)
- func (b *Bootstrapper) SetupErrorHandlers()
- func (b *Bootstrapper) SetupLogging()
- func (b *Bootstrapper) SetupPprof()
- func (b *Bootstrapper) SetupValidator()
- func (b *Bootstrapper) SetupViews(viewsDir string)
- type Configurator
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // StaticAssets is the root directory for public assets like images, css, js. StaticAssets = variable.BasePath + "/web/views/" )
Functions ¶
This section is empty.
Types ¶
type Bootstrapper ¶
type Bootstrapper struct { *iris.Application AppName string AppOwner string AppSpawnDate time.Time }
func New ¶
func New(appName, appOwner string, cfgs ...Configurator) *Bootstrapper
New returns a new Bootstrapper.
func (*Bootstrapper) Bootstrap ¶
func (b *Bootstrapper) Bootstrap() *Bootstrapper
func (*Bootstrapper) Configure ¶
func (b *Bootstrapper) Configure(cs ...Configurator)
Configure accepts configurations and runs them inside the Bootstraper's context.
func (*Bootstrapper) Listen ¶
func (b *Bootstrapper) Listen(addr string, cfgs ...iris.Configurator)
func (*Bootstrapper) ListenSock ¶
func (b *Bootstrapper) ListenSock(l net.Listener, cfgs ...iris.Configurator)
func (*Bootstrapper) SetupErrorHandlers ¶
func (b *Bootstrapper) SetupErrorHandlers()
SetupErrorHandlers `(context.StatusCodeNotSuccessful`, which defaults to >=400 (but you can change it).
func (*Bootstrapper) SetupValidator ¶
func (b *Bootstrapper) SetupValidator()
SetupValidator 参数验证 go get github.com/go-playground/validator/v10
func (*Bootstrapper) SetupViews ¶
func (b *Bootstrapper) SetupViews(viewsDir string)
SetupViews loads the templates.
type Configurator ¶
type Configurator func(*Bootstrapper)
Click to show internal directories.
Click to hide internal directories.