Documentation ¶
Index ¶
- Constants
- type CLI
- type ConnectionHandler
- type ExecutionContext
- func (ctx *ExecutionContext) CmdEditor() command.Editor
- func (ctx *ExecutionContext) Connection() ws.ConnectionHandler
- func (ctx *ExecutionContext) Formater() formater.Formater
- func (ctx *ExecutionContext) Input() <-chan keyboard.KeyEvent
- func (ctx *ExecutionContext) Macro() *command.Macro
- func (ctx *ExecutionContext) Output() io.Writer
- func (ctx *ExecutionContext) OutputFile() io.Writer
- func (ctx *ExecutionContext) RequestEditor() command.Editor
- type Formater
- type Inputer
- type Keyboard
- type RunOptions
Constants ¶
View Source
const ( MacroDir = "macro" ConfigDir = ".wsget" HistoryFilename = ConfigDir + "/history" HistoryCmdFilename = ConfigDir + "/cmd_history" ConfigDirMode = 0o755 CommandsLimit = 100 HistoryLimit = 100 MacOSDeleteKey = 127 HideCursor = "\x1b[?25l" ShowCursor = "\x1b[?25h" Bell = "\a" )
View Source
const (
KeyboardBufferSize = 10
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CLI ¶
type CLI struct {
// contains filtered or unexported fields
}
func NewCLI ¶
NewCLI creates a new CLI instance with the given wsConn, input, and output. It returns an error if it fails to get the current user, create the necessary directories, load the macro for the domain, or initialize the CLI instance.
func (*CLI) Run ¶
func (c *CLI) Run(opts RunOptions) error
Run runs the CLI with the provided options. It listens for user input and executes commands accordingly.
type ConnectionHandler ¶ added in v0.3.1
type ExecutionContext ¶ added in v0.3.0
type ExecutionContext struct {
// contains filtered or unexported fields
}
func NewExecutionContext ¶ added in v0.3.1
func (*ExecutionContext) CmdEditor ¶ added in v0.3.1
func (ctx *ExecutionContext) CmdEditor() command.Editor
func (*ExecutionContext) Connection ¶ added in v0.3.1
func (ctx *ExecutionContext) Connection() ws.ConnectionHandler
func (*ExecutionContext) Formater ¶ added in v0.3.1
func (ctx *ExecutionContext) Formater() formater.Formater
func (*ExecutionContext) Input ¶ added in v0.3.1
func (ctx *ExecutionContext) Input() <-chan keyboard.KeyEvent
func (*ExecutionContext) Macro ¶ added in v0.3.1
func (ctx *ExecutionContext) Macro() *command.Macro
func (*ExecutionContext) Output ¶ added in v0.3.1
func (ctx *ExecutionContext) Output() io.Writer
func (*ExecutionContext) OutputFile ¶ added in v0.3.1
func (ctx *ExecutionContext) OutputFile() io.Writer
func (*ExecutionContext) RequestEditor ¶ added in v0.3.1
func (ctx *ExecutionContext) RequestEditor() command.Editor
type Keyboard ¶ added in v0.2.0
type Keyboard struct{}
func NewKeyboard ¶ added in v0.2.0
func NewKeyboard() *Keyboard
Click to show internal directories.
Click to hide internal directories.