Documentation ¶
Index ¶
- Variables
- type App
- func (app *App) Bind(bf BindFunc)
- func (app *App) Bootstrap() error
- func (app *App) Configure(name string, value interface{}) *App
- func (app *App) ConfigureFS(fs fs.FS, name string, value interface{}) *App
- func (app *App) Container() container.Interface
- func (app *App) Daemon(f DaemonFn) *App
- func (app *App) Defer(f func()) *App
- func (app *App) GetConfig() Config
- func (app *App) GetEnv() string
- func (app *App) Register(service Service) *App
- func (app *App) RegisterRoutes(rr RouterRegister) *App
- func (app *App) Run() error
- func (app *App) RunDaemons(wg *sync.WaitGroup, daemon ...bool)
- func (app *App) RunDefers()
- func (app *App) Services() []Service
- type BindFunc
- type Config
- type ConfigService
- type DaemonFn
- type RouterRegister
- type Service
Constants ¶
This section is empty.
Variables ¶
View Source
var AppConfigName = "app"
AppConfigName: 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
func (*App) ConfigureFS ¶ added in v0.0.7
ConfigureFS: load config from filesystem
func (*App) Daemon ¶ added in v0.0.7
Daemon run function, start daemon service before http service started
func (*App) RegisterRoutes ¶ added in v0.0.7
func (app *App) RegisterRoutes(rr RouterRegister) *App
RegisterRoutes: register routes of http service
func (*App) RunDaemons ¶ added in v0.0.7
RunDaemons, run background services
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"` Locale string `yaml:"locale" env:"APP_LOCALE" default:"en"` Url string `yaml:"url" env:"APP_URL" default:"http://localhost"` Timezone string `yaml:"timezone" env:"APP_TIMEZONE" default:""` Key string `yaml:"key" env:"APP_KEY" default:"somerandomkey!!!"` }
Config of application
var AppConfig Config
AppConfig global var
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) Register ¶ added in v0.0.5
func (cs *ConfigService) Register(app *App) error
Register config service when app starting
type RouterRegister ¶ added in v0.0.7
Click to show internal directories.
Click to hide internal directories.