Documentation ¶
Index ¶
- Constants
- Variables
- func ValidateTargetType(execType string) bool
- type Exec
- type Executor
- type GoConfig
- type GoExecutor
- type HttpConfig
- type HttpExecutor
- func (exec *HttpExecutor) Exec(ctx *task.TaskContext) error
- func (exec *HttpExecutor) GetTargetType() string
- func (exec *HttpExecutor) GetTask() task.Task
- func (exec *HttpExecutor) GetTaskConfig() *core.TaskConfig
- func (exec *HttpExecutor) GetTaskID() string
- func (exec *HttpExecutor) SetTask(task task.Task)
- type ShellConfig
- type ShellExecutor
- func (exec *ShellExecutor) Exec(ctx *task.TaskContext) error
- func (exec *ShellExecutor) GetTargetType() string
- func (exec *ShellExecutor) GetTask() task.Task
- func (exec *ShellExecutor) GetTaskConfig() *core.TaskConfig
- func (exec *ShellExecutor) GetTaskID() string
- func (exec *ShellExecutor) SetTask(task task.Task)
Constants ¶
View Source
const ( TargetType_Http = "http" TargetType_Shell = "shell" TargetType_GoSo = "goso" TargetType_Code = "code" CorrectStatus = "200 OK" CorrectResult = "OK" )
View Source
const ( HttpMethod_HEAD = "HEAD" HttpMethod_GET = "GET" HttpMethod_POST = "POST" )
View Source
const ( ShellType_Script = "SCRIPT" ShellType_File = "FILE" ShellFilePath = "shells/" )
View Source
const GoFilePath = "plugins/"
Variables ¶
View Source
var ( ErrorNotSupportShellType = errors.New("not support shell type") ErrorShellFileNotInSpecifyPath = errors.New("shell file not in specify path") ErrorNotEnabledShellScriptMode = errors.New("shell script mode is not enabled") )
View Source
var (
ErrorGoSoFileNotInSpecifyPath = errors.New("go.so file not in specify path")
)
View Source
var ErrorNotMatchConfigType = errors.New("not match config type")
Functions ¶
func ValidateTargetType ¶
ValidateTargetType validate the TargetType is supported
Types ¶
type Executor ¶
type Executor interface { GetTask() task.Task SetTask(task.Task) GetTaskID() string GetTargetType() string GetTaskConfig() *core.TaskConfig Exec(*task.TaskContext) error }
func NewDebugGoExecutor ¶
func NewDebugHttpExecutor ¶
func NewDebugShellExecutor ¶
type GoExecutor ¶
type GoExecutor struct {
// contains filtered or unexported fields
}
func NewGoExecutor ¶
func NewGoExecutor(conf *core.TaskConfig) (*GoExecutor, error)
func (*GoExecutor) Exec ¶
func (exec *GoExecutor) Exec(ctx *task.TaskContext) error
func (*GoExecutor) GetTargetType ¶
func (exec *GoExecutor) GetTargetType() string
func (*GoExecutor) GetTaskConfig ¶
func (exec *GoExecutor) GetTaskConfig() *core.TaskConfig
type HttpConfig ¶
type HttpConfig struct { Url string Method string ContentType string PostBody string Timeout int //单位为秒 }
func (*HttpConfig) LoadFromJson ¶
func (c *HttpConfig) LoadFromJson(json string) error
type HttpExecutor ¶
type HttpExecutor struct {
// contains filtered or unexported fields
}
func NewHttpExecutor ¶
func NewHttpExecutor(conf *core.TaskConfig) (*HttpExecutor, error)
func (*HttpExecutor) Exec ¶
func (exec *HttpExecutor) Exec(ctx *task.TaskContext) error
func (*HttpExecutor) GetTargetType ¶
func (exec *HttpExecutor) GetTargetType() string
func (*HttpExecutor) GetTaskConfig ¶
func (exec *HttpExecutor) GetTaskConfig() *core.TaskConfig
type ShellConfig ¶
func (*ShellConfig) LoadFromJson ¶
func (c *ShellConfig) LoadFromJson(json string) error
type ShellExecutor ¶
type ShellExecutor struct {
// contains filtered or unexported fields
}
func NewShellExecutor ¶
func NewShellExecutor(conf *core.TaskConfig) (*ShellExecutor, error)
func (*ShellExecutor) Exec ¶
func (exec *ShellExecutor) Exec(ctx *task.TaskContext) error
func (*ShellExecutor) GetTargetType ¶
func (exec *ShellExecutor) GetTargetType() string
func (*ShellExecutor) GetTaskConfig ¶
func (exec *ShellExecutor) GetTaskConfig() *core.TaskConfig
Click to show internal directories.
Click to hide internal directories.