Documentation
¶
Index ¶
- func IsValidBinaryName(binName string) error
- func NewServiceCommandGetter(app Installable) *cobra.Command
- func ProvidersOf[T any](app *Application) []T
- type Application
- func (i *Application) Boot(ctx context.Context) error
- func (i *Application) Booted(callback func(application foundation.Application))
- func (i *Application) Booting(callback func(application foundation.Application))
- func (i *Application) ConsoleShell(rootCmd *cobra.Command) error
- func (i *Application) DebugContainer() string
- func (i *Application) Environment(s ...string) (string, bool)
- func (i *Application) GetBasePath() string
- func (i *Application) GetBootstrapPath() string
- func (i *Application) GetConfigPath() string
- func (i *Application) GetLangPath() string
- func (i *Application) GetLocale() string
- func (i *Application) GetProviders(provider interface{}) []interface{}
- func (i *Application) GetPublicPath() string
- func (i *Application) GetResourcePath() string
- func (i *Application) GetStoragePath() string
- func (i *Application) HasBeenBootstrapped() bool
- func (i *Application) Invoke(function interface{}, opts ...dig.InvokeOption) error
- func (i *Application) IsDownForMaintenance() bool
- func (i *Application) LifecycleState() string
- func (i *Application) MaintenanceMode() context.Context
- func (i *Application) Provide(function interface{}, opts ...dig.ProvideOption) error
- func (i *Application) Register(providers ...any) error
- func (i *Application) RunMode() foundation.RunMode
- func (i *Application) SetLocale(locale string)
- func (i *Application) SetMaintenanceMode(down bool)
- func (i *Application) ShowProviders()
- func (i *Application) ShowSubApps()
- func (i *Application) Terminate(ctx context.Context) error
- func (i *Application) Terminating(callback interface{}) foundation.Application
- func (i *Application) Version() string
- func (i *Application) WebShell() error
- type Installable
- type ServiceCommandGetter
- type SubApp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidBinaryName ¶
IsValidBinaryName 检查二进制文件名是否合法
func NewServiceCommandGetter ¶
func NewServiceCommandGetter(app Installable) *cobra.Command
func ProvidersOf ¶ added in v1.1.0
func ProvidersOf[T any](app *Application) []T
ProvidersOf 按类型过滤已注册 Provider(推荐;避免 GetProviders + 断言)。
Types ¶
type Application ¶
func (*Application) Boot ¶
func (i *Application) Boot(ctx context.Context) error
func (*Application) Booted ¶
func (i *Application) Booted(callback func(application foundation.Application))
func (*Application) Booting ¶
func (i *Application) Booting(callback func(application foundation.Application))
func (*Application) ConsoleShell ¶
func (i *Application) ConsoleShell(rootCmd *cobra.Command) error
ConsoleShell 使用命令行壳启动系统。
func (*Application) DebugContainer ¶ added in v1.1.0
func (i *Application) DebugContainer() string
DebugContainer 返回 dig 依赖图文本,便于诊断缺失依赖。
func (*Application) Environment ¶
func (i *Application) Environment(s ...string) (string, bool)
func (*Application) GetBasePath ¶
func (i *Application) GetBasePath() string
func (*Application) GetBootstrapPath ¶
func (i *Application) GetBootstrapPath() string
func (*Application) GetConfigPath ¶
func (i *Application) GetConfigPath() string
func (*Application) GetLangPath ¶
func (i *Application) GetLangPath() string
func (*Application) GetLocale ¶
func (i *Application) GetLocale() string
func (*Application) GetProviders ¶
func (i *Application) GetProviders(provider interface{}) []interface{}
func (*Application) GetPublicPath ¶
func (i *Application) GetPublicPath() string
func (*Application) GetResourcePath ¶
func (i *Application) GetResourcePath() string
func (*Application) GetStoragePath ¶
func (i *Application) GetStoragePath() string
func (*Application) HasBeenBootstrapped ¶
func (i *Application) HasBeenBootstrapped() bool
func (*Application) Invoke ¶
func (i *Application) Invoke(function interface{}, opts ...dig.InvokeOption) error
func (*Application) IsDownForMaintenance ¶
func (i *Application) IsDownForMaintenance() bool
func (*Application) LifecycleState ¶ added in v1.1.0
func (i *Application) LifecycleState() string
func (*Application) MaintenanceMode ¶
func (i *Application) MaintenanceMode() context.Context
func (*Application) Provide ¶
func (i *Application) Provide(function interface{}, opts ...dig.ProvideOption) error
func (*Application) Register ¶
func (i *Application) Register(providers ...any) error
func (*Application) RunMode ¶ added in v1.2.0
func (i *Application) RunMode() foundation.RunMode
RunMode returns the current application shell mode.
func (*Application) SetLocale ¶
func (i *Application) SetLocale(locale string)
func (*Application) SetMaintenanceMode ¶ added in v1.1.0
func (i *Application) SetMaintenanceMode(down bool)
SetMaintenanceMode 更新应用维护状态。
func (*Application) ShowProviders ¶
func (i *Application) ShowProviders()
func (*Application) ShowSubApps ¶
func (i *Application) ShowSubApps()
func (*Application) Terminate ¶
func (i *Application) Terminate(ctx context.Context) error
func (*Application) Terminating ¶
func (i *Application) Terminating(callback interface{}) foundation.Application
func (*Application) Version ¶
func (i *Application) Version() string
type Installable ¶
type ServiceCommandGetter ¶
type ServiceCommandGetter struct {
// contains filtered or unexported fields
}
func (*ServiceCommandGetter) Lang ¶
func (i *ServiceCommandGetter) Lang()
type SubApp ¶
type SubApp interface {
Name() string
RegisterRouters()
ServiceProviders() []foundation.ServiceProvider
Binds() []any
Menu() []*router.Menu
Commands() []*cobra.Command
// Bootstrap 应用启动前执行,如初始化配置,初始化数据,初始化表结构等
Bootstrap()
}
SubApp 子应用
Source Files
¶
- application.go
- service_installer.go
Directories
¶
| Path | Synopsis |
|---|---|
|
core
|
|
|
provider
|
|
|
runtime
|
|
|
testing
|
|
|
tooling
|
|
|
cmd/checkdeps
command
|
|
|
cmd/harbor
command
|
|
|
file: url_match.go Package urlmatch 提供与 Gin 路由语义一致的 URL 匹配工具(对称匹配)
|
file: url_match.go Package urlmatch 提供与 Gin 路由语义一致的 URL 匹配工具(对称匹配) |
|
structs
Package structs contains various utilities functions to work with structs.
|
Package structs contains various utilities functions to work with structs. |
|
x
|
|
Click to show internal directories.
Click to hide internal directories.