Documentation
¶
Overview ¶
Package commandstarter 提供基于 cli.v2 的命令行应用启动器实现,负责命令行应用的完整生命周期管理和启动流程编排。
Index ¶
- func NewCoreCmdCli(ctx fiberhouse.ICommandContext, opts ...fiberhouse.CoreCmdStarterOption) fiberhouse.CoreCmdStarter
- func NewFrameCmdApplication(ctx fiberhouse.ICommandContext, opts ...fiberhouse.FrameCmdStarterOption) fiberhouse.FrameCmdStarter
- func RunCommandStarter(starter fiberhouse.CommandStarter)
- type CMDLineApplication
- type CoreCmdCli
- func (ccc *CoreCmdCli) AppCoreRun() error
- func (ccc *CoreCmdCli) GetAppContext() fiberhouse.ICommandContext
- func (ccc *CoreCmdCli) GetCoreCmdApp() fiberhouse.CoreCmdStarter
- func (ccc *CoreCmdCli) InitCoreApp()
- func (ccc *CoreCmdCli) RegisterCommands(fca fiberhouse.FrameCmdStarter)
- func (ccc *CoreCmdCli) RegisterCoreApp(core interface{})
- func (ccc *CoreCmdCli) RegisterCoreGlobalOptional(fca fiberhouse.FrameCmdStarter)
- func (ccc *CoreCmdCli) RegisterGlobalErrHandler(fca fiberhouse.FrameCmdStarter)
- type FrameCmdApplication
- func (fca *FrameCmdApplication) GetApplication() fiberhouse.IApplication
- func (fca *FrameCmdApplication) GetContext() fiberhouse.ICommandContext
- func (fca *FrameCmdApplication) GetFrameCmdApp() fiberhouse.FrameCmdStarter
- func (fca *FrameCmdApplication) RegisterApplication(application fiberhouse.ApplicationCmdRegister)
- func (fca *FrameCmdApplication) RegisterApplicationGlobals()
- func (fca *FrameCmdApplication) RegisterLoggerWithOriginToContainer()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCoreCmdCli ¶
func NewCoreCmdCli(ctx fiberhouse.ICommandContext, opts ...fiberhouse.CoreCmdStarterOption) fiberhouse.CoreCmdStarter
NewCoreCmdCli 实例化核心命令行应用cli启动器
func NewFrameCmdApplication ¶
func NewFrameCmdApplication(ctx fiberhouse.ICommandContext, opts ...fiberhouse.FrameCmdStarterOption) fiberhouse.FrameCmdStarter
NewFrameCmdApplication 创建一个命令启动器对象,实现FrameCmdStarter接口
func RunCommandStarter ¶
func RunCommandStarter(starter fiberhouse.CommandStarter)
RunCommandStarter 运行命令启动器
Types ¶
type CMDLineApplication ¶
type CMDLineApplication struct {
fiberhouse.FrameCmdStarter
fiberhouse.CoreCmdStarter
}
CMDLineApplication 是组合命令行应用启动器,实现 fiberhouse.FrameCmdStarter 和 fiberhouse.CoreCmdStarter 接口。
type CoreCmdCli ¶
type CoreCmdCli struct {
Ctx fiberhouse.ICommandContext
// contains filtered or unexported fields
}
CoreCmdCli 核心命令行应用cli启动器
func (*CoreCmdCli) GetAppContext ¶
func (ccc *CoreCmdCli) GetAppContext() fiberhouse.ICommandContext
GetAppContext 获取全局上下文
func (*CoreCmdCli) GetCoreCmdApp ¶
func (ccc *CoreCmdCli) GetCoreCmdApp() fiberhouse.CoreCmdStarter
GetCoreCmdApp 获取核心命令行启动器实例
func (*CoreCmdCli) RegisterCommands ¶
func (ccc *CoreCmdCli) RegisterCommands(fca fiberhouse.FrameCmdStarter)
RegisterCommands 注册命令列表到核心应用
func (*CoreCmdCli) RegisterCoreApp ¶
func (ccc *CoreCmdCli) RegisterCoreApp(core interface{})
RegisterCoreApp 注册底层核心应用对象
func (*CoreCmdCli) RegisterCoreGlobalOptional ¶
func (ccc *CoreCmdCli) RegisterCoreGlobalOptional(fca fiberhouse.FrameCmdStarter)
RegisterCoreGlobalOptional 注册应用核心的全局可选项
func (*CoreCmdCli) RegisterGlobalErrHandler ¶
func (ccc *CoreCmdCli) RegisterGlobalErrHandler(fca fiberhouse.FrameCmdStarter)
RegisterGlobalErrHandler 核心应用全局错误处理器
type FrameCmdApplication ¶
type FrameCmdApplication struct {
Ctx fiberhouse.ICommandContext
// contains filtered or unexported fields
}
FrameCmdApplication 是命令行应用启动器,实现 fiberhouse.FrameCmdStarter 接口。 负责管理命令行应用的生命周期,包括初始化、注册全局选项和动作、运行应用及错误处理。
func (*FrameCmdApplication) GetApplication ¶
func (fca *FrameCmdApplication) GetApplication() fiberhouse.IApplication
GetApplication 获取应用接口对象
func (*FrameCmdApplication) GetContext ¶
func (fca *FrameCmdApplication) GetContext() fiberhouse.ICommandContext
GetContext 获取全局上下文
func (*FrameCmdApplication) GetFrameCmdApp ¶
func (fca *FrameCmdApplication) GetFrameCmdApp() fiberhouse.FrameCmdStarter
GetFrameCmdApp 获取框架命令行启动器实例
func (*FrameCmdApplication) RegisterApplication ¶
func (fca *FrameCmdApplication) RegisterApplication(application fiberhouse.ApplicationCmdRegister)
RegisterApplication 注册应用命令注册器到应用启动器
func (*FrameCmdApplication) RegisterApplicationGlobals ¶
func (fca *FrameCmdApplication) RegisterApplicationGlobals()
RegisterApplicationGlobals 注册应用全局对象初始化器和初始化部分必要对象
func (*FrameCmdApplication) RegisterLoggerWithOriginToContainer ¶
func (fca *FrameCmdApplication) RegisterLoggerWithOriginToContainer()
RegisterLoggerWithOriginToContainer 注册配置文件预定义的不同来源(LogOrigin)的子日志器初始化器到容器