bootstrap

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: MulanPSL-2.0 Imports: 19 Imported by: 0

Documentation

Index

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) SetupLogging

func (b *Bootstrapper) SetupLogging()

SetupLogging 设置请求日志

func (*Bootstrapper) SetupPprof

func (b *Bootstrapper) SetupPprof()

SetupPprof 设置性能监控

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)

Jump to

Keyboard shortcuts

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