app

package
v0.5.12 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AfterProvider

func AfterProvider(bean interface{}, alias string)

AfterProvider 在 Initialize 函数后执行

func EnvIsDev

func EnvIsDev() bool

func EnvIsLocal

func EnvIsLocal() bool

func EnvIsProduction

func EnvIsProduction() bool

func EnvIsStaging

func EnvIsStaging() bool

func EnvIsTesting

func EnvIsTesting() bool

func GetBean

func GetBean(alias string) interface{}

GetBean 只能返回指针的值

func HasBean

func HasBean(alias string) bool

func RunBoot

func RunBoot()

RunBoot 所有的 Init() 执行后, 触发Boot() Boot() 、Init() 是倒叙执行, 被依赖的先执行 Boot() 如果是嵌套多个Bean, 可能被多次执行

func RunExit

func RunExit()

RunExit 是顺序执行, 发起依赖的先执行(http->config)

func RunRunAfter added in v0.5.3

func RunRunAfter()

func SetEnvironment

func SetEnvironment(env string)

Types

type AppendRun

type AppendRun interface {
	AppendRun(fun func())
}

type Bean

type Bean interface {
	// GetBean 只能返回指针的值
	GetBean(alias string) interface{}
}

type Environment

type Environment string
var (
	EnvironmentNow        Environment = ""
	EnvironmentLocal      Environment = "local"
	EnvironmentDev        Environment = "dev"
	EnvironmentTesting    Environment = "testing"
	EnvironmentStaging    Environment = "staging"
	EnvironmentProduction Environment = "production"
)

func GetEnvironment

func GetEnvironment() Environment

Jump to

Keyboard shortcuts

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