Documentation
¶
Index ¶
- Constants
- type CLI
- type CommandCmdEdit
- type CommandEdit
- type CommandExit
- type CommandPrintMsg
- type CommandSend
- type CommandSequence
- type CommandWaitForResp
- type Config
- type Content
- func (c *Content) Clear() string
- func (c *Content) GetLinesAfterPosition(pos int) (startOfLine int, lines []string)
- func (c *Content) InsertSymbol(symbol rune) string
- func (c *Content) MovePositionLeft() string
- func (c *Content) MovePositionRight() string
- func (c *Content) MoveToEnd() string
- func (c *Content) PrevSymbol() rune
- func (c *Content) RemoveSymbol() string
- func (c *Content) ReplaceText(text string) string
- func (c *Content) String() string
- func (c *Content) ToRequest() string
- type Editor
- type Executer
- type ExecutionContext
- type History
- type Inputer
- type Keyboard
- type Macro
- 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 ( LineUp = "\x1b[1A" LineClear = "\x1b[2K" NewLine = '\n' ReturnCarriege = "\r" Backspace = "\b" )
View Source
const ( PastingTimingThresholdInMicrosec = 250 ErrInterrupted = "interrupted" )
View Source
const (
CommandPartsNumber = 2
)
View Source
const (
HistoryFileRigths = 0o644
)
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 (*CLI) Run ¶
func (c *CLI) Run(opts RunOptions) error
type CommandCmdEdit ¶ added in v0.3.0
type CommandCmdEdit struct{}
func NewCommandCmdEdit ¶ added in v0.3.0
func NewCommandCmdEdit() *CommandCmdEdit
func (*CommandCmdEdit) Execute ¶ added in v0.3.0
func (c *CommandCmdEdit) Execute(exCtx *ExecutionContext) (Executer, error)
type CommandEdit ¶ added in v0.3.0
type CommandEdit struct {
// contains filtered or unexported fields
}
func NewCommandEdit ¶ added in v0.3.0
func NewCommandEdit(content string) *CommandEdit
func (*CommandEdit) Execute ¶ added in v0.3.0
func (c *CommandEdit) Execute(exCtx *ExecutionContext) (Executer, error)
type CommandExit ¶ added in v0.3.0
type CommandExit struct{}
func NewCommandExit ¶ added in v0.3.0
func NewCommandExit() *CommandExit
func (*CommandExit) Execute ¶ added in v0.3.0
func (c *CommandExit) Execute(_ *ExecutionContext) (Executer, error)
type CommandPrintMsg ¶ added in v0.3.0
type CommandPrintMsg struct {
// contains filtered or unexported fields
}
func NewCommandPrintMsg ¶ added in v0.3.0
func NewCommandPrintMsg(msg ws.Message) *CommandPrintMsg
func (*CommandPrintMsg) Execute ¶ added in v0.3.0
func (c *CommandPrintMsg) Execute(exCtx *ExecutionContext) (Executer, error)
type CommandSend ¶ added in v0.3.0
type CommandSend struct {
// contains filtered or unexported fields
}
func NewCommandSend ¶ added in v0.3.0
func NewCommandSend(request string) *CommandSend
func (*CommandSend) Execute ¶ added in v0.3.0
func (c *CommandSend) Execute(exCtx *ExecutionContext) (Executer, error)
type CommandSequence ¶ added in v0.3.0
type CommandSequence struct {
// contains filtered or unexported fields
}
func NewCommandSequence ¶ added in v0.3.0
func NewCommandSequence(subCommands []Executer) *CommandSequence
func (*CommandSequence) Execute ¶ added in v0.3.0
func (c *CommandSequence) Execute(exCtx *ExecutionContext) (Executer, error)
type CommandWaitForResp ¶ added in v0.3.0
type CommandWaitForResp struct {
// contains filtered or unexported fields
}
func NewCommandWaitForResp ¶ added in v0.3.0
func NewCommandWaitForResp(timeout time.Duration) *CommandWaitForResp
func (*CommandWaitForResp) Execute ¶ added in v0.3.0
func (c *CommandWaitForResp) Execute(exCtx *ExecutionContext) (Executer, error)
type Content ¶ added in v0.2.0
type Content struct {
// contains filtered or unexported fields
}
func NewContent ¶ added in v0.2.0
func NewContent() *Content
func (*Content) GetLinesAfterPosition ¶ added in v0.2.0
func (*Content) InsertSymbol ¶ added in v0.2.0
func (*Content) MovePositionLeft ¶ added in v0.2.0
func (*Content) MovePositionRight ¶ added in v0.2.0
func (*Content) PrevSymbol ¶ added in v0.2.0
func (*Content) RemoveSymbol ¶ added in v0.2.0
func (*Content) ReplaceText ¶ added in v0.2.0
type Editor ¶ added in v0.2.0
type Editor struct {
History *History
// contains filtered or unexported fields
}
type Executer ¶ added in v0.3.0
type Executer interface {
Execute(*ExecutionContext) (Executer, error)
}
type ExecutionContext ¶ added in v0.3.0
type ExecutionContext struct {
// contains filtered or unexported fields
}
type History ¶
type History struct {
// contains filtered or unexported fields
}
func NewHistory ¶
func (*History) AddRequest ¶
func (*History) NextRequst ¶ added in v0.2.0
func (*History) PrevRequst ¶ added in v0.2.0
func (*History) ResetPosition ¶ added in v0.2.0
func (h *History) ResetPosition()
func (*History) SaveToFile ¶ added in v0.1.2
type Keyboard ¶ added in v0.2.0
type Keyboard struct{}
func NewKeyboard ¶ added in v0.2.0
func NewKeyboard() *Keyboard
type Macro ¶ added in v0.3.0
type Macro struct {
// contains filtered or unexported fields
}
func LoadMacroForDomain ¶ added in v0.3.0
func (*Macro) AddCommands ¶ added in v0.3.0
type RunOptions ¶ added in v0.2.0
Click to show internal directories.
Click to hide internal directories.