app

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cfg

func Cfg() *cfg.ServerConfiguration

func Db

func Db() *gorm.DB

func DevelopmentMode

func DevelopmentMode() bool

func Environment

func Environment() mode.AppMode

func Name

func Name() string

func ReloadConfig

func ReloadConfig()

func Version

func Version() version.Info

Types

type Application

type Application struct {
	Name       string
	Desc       string
	Version    version.Info
	Mode       mode.AppMode // 用于加载不同环境变量和配置文件
	Port       int
	DebugLog   bool
	VerboseLog bool
	// contains filtered or unexported fields
}

func New

func New(name string, desc string) *Application

func (*Application) AddBoot

func (a *Application) AddBoot(fn BootFunc)

func (*Application) AddBoots

func (a *Application) AddBoots(boots ...Bootstrapper)

func (*Application) Route

func (a *Application) Route(fn RouteFunc)

func (*Application) Run

func (a *Application) Run(arguments []string) (err error)

func (*Application) SetConfigPath

func (a *Application) SetConfigPath(path string)

type BootFunc

type BootFunc func() error

func (BootFunc) Boot

func (bf BootFunc) Boot() error

type Bootstrapper

type Bootstrapper interface {
	// Name() string
	Boot() error
}

type Launcher

type Launcher struct {
	Boots []Bootstrapper
}

func (*Launcher) Add

func (l *Launcher) Add(boots ...Bootstrapper)

func (*Launcher) Prepend

func (l *Launcher) Prepend(boots ...Bootstrapper)

func (*Launcher) Run

func (l *Launcher) Run()

type RouteFunc

type RouteFunc func(*fiber.App)

Jump to

Keyboard shortcuts

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