Documentation
¶
Index ¶
Constants ¶
View Source
const (
CommandConfigName = "CommandConf"
)
Variables ¶
View Source
var Component = &CommandComponent{}
Functions ¶
This section is empty.
Types ¶
type CommandComponent ¶ added in v0.3.2
type CommandComponent struct{}
func (*CommandComponent) Inject ¶ added in v0.3.2
func (i *CommandComponent) Inject(instance any) bool
func (*CommandComponent) InjectConf ¶ added in v0.4.0
func (i *CommandComponent) InjectConf(config cComponents.ConfigInterface) bool
func (*CommandComponent) Listen ¶ added in v0.4.0
func (i *CommandComponent) Listen() []*cComponents.ConfigListener
func (*CommandComponent) Load ¶ added in v0.3.2
func (i *CommandComponent) Load()
type CommandConf ¶
type CommandConf struct { Enable bool `json:"enable"` CommandLine bool `json:"command_line"` Commands []*CommandConf_Command `json:"commands"` }
func (*CommandConf) ConfigName ¶
func (i *CommandConf) ConfigName() string
type CommandConf_Command ¶
type CommandConf_Command struct { // 配置项 Mode CommandMode `json:"mode"` // 执行模式 Instant bool `json:"instant"` // 是否立即执行, sync 模式忽略此参数, 异步模式先执行一次, 再启动定时任务 Wait int `json:"wait"` // 每次执行等待时长 Try int `json:"try"` // 执行次数 Cron string `json:"cron"` // 定时器 App string `json:"app"` Command string `json:"command"` Method string `json:"method"` Options []string `json:"options"` // 调用参数, 按顺序传入 // contains filtered or unexported fields }
func (*CommandConf_Command) Incr ¶ added in v0.4.0
func (i *CommandConf_Command) Incr()
func (*CommandConf_Command) Runnable ¶ added in v0.4.0
func (i *CommandConf_Command) Runnable() bool
func (*CommandConf_Command) SetID ¶ added in v0.4.0
func (i *CommandConf_Command) SetID(id cron.EntryID)
func (*CommandConf_Command) TryLock ¶ added in v0.4.0
func (i *CommandConf_Command) TryLock() bool
func (*CommandConf_Command) Unlock ¶ added in v0.4.0
func (i *CommandConf_Command) Unlock()
type CommandContainer ¶
type CommandContainer struct {
// contains filtered or unexported fields
}
func (*CommandContainer) Get ¶ added in v0.0.16
func (i *CommandContainer) Get(name string) any
func (*CommandContainer) Is ¶ added in v0.4.0
func (i *CommandContainer) Is(instance any) bool
func (*CommandContainer) Range ¶ added in v0.4.0
func (i *CommandContainer) Range(f func(instance any))
func (*CommandContainer) Remove ¶ added in v0.4.0
func (i *CommandContainer) Remove(name string) bool
func (*CommandContainer) Save ¶ added in v0.0.16
func (i *CommandContainer) Save(instance any) bool
func (*CommandContainer) UpdateCommands ¶ added in v0.4.7
func (i *CommandContainer) UpdateCommands()
type CommandInterface ¶
type CommandInterface interface {
CommandName() (app, name string)
}
type CommandMode ¶ added in v0.4.0
type CommandMode int
const ( CommandMode_Single CommandMode = iota // 异步串行 CommandMode_Multi // 异步并行 CommandMode_Sync // 同步单次执行 CommandMode_Line // 命令行执行 )
Click to show internal directories.
Click to hide internal directories.