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