Documentation ¶
Index ¶
- Constants
- func GetAllCmds() map[string]*WrappedCmd
- func RegisterCmd(s string, cmd *WrappedCmd)
- func SplitCommandParams(cmd string) (string, []string)
- type CmdError
- type CmdHandler
- type CmdOutput
- type CmdResult
- type CmdType
- type Command
- func (this *Command) ConsoleExec(param *ParamsValue, console IConsole) *promise.Promise
- func (this *Command) Exec(params ...interface{}) *promise.Promise
- func (this *Command) ExecWithConsole(console IConsole, params ...interface{}) *promise.Promise
- func (this *Command) Name() string
- func (this *Command) SetConsole(console IConsole)
- func (this *Command) Tips() string
- type ICommand
- type ICommandSender
- type IConsole
- type ParamsValue
- func (this *ParamsValue) Bool() bool
- func (this *ParamsValue) BoolOpt() bool
- func (this *ParamsValue) Clone() *ParamsValue
- func (this *ParamsValue) Float() float64
- func (this *ParamsValue) FloatOpt() float64
- func (this *ParamsValue) ForceString() string
- func (this *ParamsValue) Int() int
- func (this *ParamsValue) Int32() int32
- func (this *ParamsValue) Int32Opt() int32
- func (this *ParamsValue) Int64() int64
- func (this *ParamsValue) Int64Opt() int64
- func (this *ParamsValue) IntOpt() int
- func (this *ParamsValue) IsHelp() bool
- func (this *ParamsValue) LeftParams() []interface{}
- func (this *ParamsValue) Len() int
- func (this *ParamsValue) String() string
- func (this *ParamsValue) StringOpt() string
- type WrappedCmd
Constants ¶
View Source
const ( Cmd_Shell = "shell" Cmd_Expect = "expect" )
View Source
const ( CMD_ERROR_PARAM_LEN = iota CMD_ERROR_PARAM_TYPE )
Variables ¶
This section is empty.
Functions ¶
func GetAllCmds ¶
func GetAllCmds() map[string]*WrappedCmd
func RegisterCmd ¶
func RegisterCmd(s string, cmd *WrappedCmd)
func SplitCommandParams ¶
Types ¶
type CmdHandler ¶
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
func (*Command) ConsoleExec ¶
func (this *Command) ConsoleExec(param *ParamsValue, console IConsole) *promise.Promise
func (*Command) ExecWithConsole ¶
func (*Command) SetConsole ¶
type ICommand ¶
type ICommand interface { Name() string SetConsole(IConsole) ConsoleExec(param *ParamsValue, console IConsole) *promise.Promise ExecWithConsole(console IConsole, params ...interface{}) *promise.Promise Exec(params ...interface{}) *promise.Promise Tips() string }
func NewCommand ¶
func NewCommandNoConsole ¶
type ICommandSender ¶
type ICommandSender interface { SendCmd(string) OnSelect() OnDeselect() }
type ParamsValue ¶
type ParamsValue struct {
// contains filtered or unexported fields
}
func NewParamsValue ¶
func NewParamsValue(cmd string, value ...interface{}) *ParamsValue
func (*ParamsValue) Bool ¶
func (this *ParamsValue) Bool() bool
func (*ParamsValue) BoolOpt ¶
func (this *ParamsValue) BoolOpt() bool
func (*ParamsValue) Clone ¶ added in v0.1.30
func (this *ParamsValue) Clone() *ParamsValue
func (*ParamsValue) Float ¶
func (this *ParamsValue) Float() float64
func (*ParamsValue) FloatOpt ¶
func (this *ParamsValue) FloatOpt() float64
func (*ParamsValue) ForceString ¶ added in v0.1.30
func (this *ParamsValue) ForceString() string
func (*ParamsValue) Int ¶
func (this *ParamsValue) Int() int
func (*ParamsValue) Int32 ¶
func (this *ParamsValue) Int32() int32
func (*ParamsValue) Int32Opt ¶
func (this *ParamsValue) Int32Opt() int32
func (*ParamsValue) Int64 ¶
func (this *ParamsValue) Int64() int64
func (*ParamsValue) Int64Opt ¶
func (this *ParamsValue) Int64Opt() int64
func (*ParamsValue) IntOpt ¶
func (this *ParamsValue) IntOpt() int
func (*ParamsValue) IsHelp ¶
func (this *ParamsValue) IsHelp() bool
func (*ParamsValue) LeftParams ¶
func (this *ParamsValue) LeftParams() []interface{}
func (*ParamsValue) Len ¶
func (this *ParamsValue) Len() int
func (*ParamsValue) String ¶
func (this *ParamsValue) String() string
func (*ParamsValue) StringOpt ¶
func (this *ParamsValue) StringOpt() string
type WrappedCmd ¶
type WrappedCmd struct { CmdString string Tips string ParamsNum int ParamsMap []string CmdType CmdType CmdHandler CmdHandler }
func GetCmdByName ¶
func GetCmdByName(s string) *WrappedCmd
func (*WrappedCmd) FillParams ¶
func (this *WrappedCmd) FillParams(param ...string) string
Click to show internal directories.
Click to hide internal directories.