Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AppConfig = "app"
AppConfig: default app config name
View Source
var ConfigExt = ".yaml"
ConfigExt: default config extension
Functions ¶
This section is empty.
Types ¶
type App ¶ added in v0.0.5
type App struct {
// contains filtered or unexported fields
}
App: framework application
type Config ¶ added in v0.0.5
type Config struct { Env string `yaml:"env" env:"APP_ENV" default:"production"` Debug bool `yaml:"debug" env:"APP_DEBUG" default:"false"` }
Config of application
type ConfigService ¶ added in v0.0.5
type ConfigService struct {
// contains filtered or unexported fields
}
ConfigService of application
func (*ConfigService) Add ¶ added in v0.0.5
func (cs *ConfigService) Add(name string, config interface{}) *ConfigService
Add config instance to service
func (*ConfigService) Lifetime ¶ added in v0.0.5
func (cs *ConfigService) Lifetime(container container.Interface, request contracts.RequestContract)
Lifetime container callback register config instance to request IoC-Container
func (*ConfigService) Register ¶ added in v0.0.5
func (cs *ConfigService) Register(app *App) error
Register config service when app starting
type Service ¶ added in v0.0.5
type Service interface { //Register service when app starting, before http server start // you can configure service, initialize global vars etc. // running at main goroutine Register(app *App) error //Lifetime container callback // usually register request lifetime instance to IoC-Container (per-request unique) // this function will run before every request Lifetime(ioc container.Interface, request contracts.RequestContract) }
Click to show internal directories.
Click to hide internal directories.