Documentation
¶
Index ¶
- type DelayCmd
- type Executor
- func (e *Executor) Execute() (int, error)
- func (e *Executor) SetInputFunc(f func(key, action string, durationTicks int64) error)
- func (e *Executor) SetMouseFunc(f func(action string, x, y int, button string, durationTicks int64) error)
- func (e *Executor) SetScreenshotFunc(f func(output string, async bool) error)
- func (e *Executor) SetWheelFunc(f func(x, y float64) error)
- type InputCmd
- type MouseCmd
- type Node
- type RepeatCmd
- type RepeatCmdRaw
- type ScreenshotCmd
- type Script
- type WheelCmd
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor executes a script.
func (*Executor) SetInputFunc ¶
SetInputFunc sets the function to call for input commands.
func (*Executor) SetMouseFunc ¶
func (e *Executor) SetMouseFunc(f func(action string, x, y int, button string, durationTicks int64) error)
SetMouseFunc sets the function to call for mouse commands.
func (*Executor) SetScreenshotFunc ¶
SetScreenshotFunc sets the function to call for screenshot commands.
func (*Executor) SetWheelFunc ¶
SetWheelFunc sets the function to call for wheel commands.
type InputCmd ¶
type InputCmd struct {
Action string `json:"action"`
Key string `json:"key"`
DurationTicks int64 `json:"duration_ticks"`
}
InputCmd represents an input command.
type MouseCmd ¶
type MouseCmd struct {
Action string `json:"action"`
X int `json:"x"`
Y int `json:"y"`
Button string `json:"button"`
DurationTicks int64 `json:"duration_ticks"`
}
MouseCmd represents a mouse command.
type Node ¶
type Node interface {
// contains filtered or unexported methods
}
Node represents a node in the script AST.
type RepeatCmdRaw ¶
type RepeatCmdRaw struct {
Times int `json:"times"`
Commands []json.RawMessage `json:"commands"`
}
RepeatCmdRaw is used during parsing to hold raw JSON commands.
type ScreenshotCmd ¶
ScreenshotCmd represents a screenshot command.
type Script ¶
Script is the root node of a script.
func ParseBytes ¶
ParseBytes parses a script from JSON bytes.
func ParseString ¶
ParseString parses a script from a JSON string.