Documentation ¶
Index ¶
- Variables
- type App
- func (app *App) Bind(bf BindFunc)
- func (app *App) Bootstrap() (e error)
- func (app *App) Configure(name string, value interface{}) error
- func (app *App) ConfigureFS(fs fs.FS, name string, value interface{}) error
- 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) Resolving(fn interface{})
- 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 LogChannelConfig
- type LoggingConfig
- type LoggingService
- type RouterRegister
- type Service
Constants ¶
This section is empty.
Variables ¶
var AppConfigName = "app"
AppConfigName: default app config name
var ConfigExt = ".yaml"
ConfigExt: default config extension
var (
LabelKey = "label"
)
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) Resolving ¶ added in v0.1.0
func (app *App) Resolving(fn interface{})
Resolving call fn after all services registered, fn paramters can be injected from global ioc-container
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"` Timezone string `yaml:"timezone" env:"APP_TIMEZONE" default:"UTC"` 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 LogChannelConfig ¶ added in v0.1.0
type LoggingConfig ¶ added in v0.1.0
type LoggingConfig struct { Default string `yaml:"default" env:"LOGGING_CHANNEL" default:"default"` Channels map[string]LogChannelConfig }
type LoggingService ¶ added in v0.1.0
type LoggingService struct {
// contains filtered or unexported fields
}
func NewLoggingService ¶ added in v0.1.0
func NewLoggingService(baseDir string) *LoggingService
func (*LoggingService) Register ¶ added in v0.1.0
func (s *LoggingService) Register(app *App) error
Register service when app starting, before http server start you can configure service, prepare global vars etc. running at main goroutine