Documentation
¶
Index ¶
- Variables
- func IsTmuxKey(input string) (isKey bool)
- type TmuxService
- func (t *TmuxService) GetCommandExecutor() (commandExecutor commandexecutorinterfaces.CommandExecutor, err error)
- func (t *TmuxService) GetSessionByName(name string) (tmuxSession *TmuxSession, err error)
- func (t *TmuxService) GetWindowByNames(sessionName string, windowName string) (window *TmuxWindow, err error)
- func (t *TmuxService) ListSessionNames(ctx context.Context) (sessionNames []string, err error)
- func (t *TmuxService) SetCommandExecutor(commandExecutor commandexecutorinterfaces.CommandExecutor) (err error)
- type TmuxSession
- func (t *TmuxSession) Create(ctx context.Context) (err error)
- func (t *TmuxSession) Delete(ctx context.Context) (err error)
- func (t *TmuxSession) Exists(ctx context.Context) (exists bool, err error)
- func (t *TmuxSession) GetCommandExecutor() (commandExecutor commandexecutorinterfaces.CommandExecutor, err error)
- func (t *TmuxSession) GetName() (name string, err error)
- func (t *TmuxSession) GetTmux() (tmux *TmuxService, err error)
- func (t *TmuxSession) GetWindowByName(windowName string) (window *TmuxWindow, err error)
- func (t *TmuxSession) ListWindowNames(ctx context.Context) (windowsNames []string, err error)
- func (t *TmuxSession) Recreate(ctx context.Context) (err error)
- func (t *TmuxSession) SetName(name string) (err error)
- func (t *TmuxSession) SetTmux(tmux *TmuxService) (err error)
- type TmuxWindow
- func (t *TmuxWindow) Create(ctx context.Context) (err error)
- func (t *TmuxWindow) Delete(ctx context.Context) (err error)
- func (t *TmuxWindow) DeleteSession(ctx context.Context) (err error)
- func (t *TmuxWindow) Exists(ctx context.Context) (exists bool, err error)
- func (t *TmuxWindow) GetCommandExecutor() (commandExecutor commandexecutorinterfaces.CommandExecutor, err error)
- func (t *TmuxWindow) GetLatestPaneLine() (paneLine string, err error)
- func (t *TmuxWindow) GetName() (name string, err error)
- func (t *TmuxWindow) GetSecondLatestPaneLine() (paneLine string, err error)
- func (t *TmuxWindow) GetSession() (session *TmuxSession, err error)
- func (t *TmuxWindow) GetSessionAndWindowName() (sessionName string, windowName string, err error)
- func (t *TmuxWindow) GetSessionName() (sessionName string, err error)
- func (t *TmuxWindow) GetShownLines() (lines []string, err error)
- func (t *TmuxWindow) GetShownOutput() (output string, err error)
- func (t *TmuxWindow) IsOutputMatchingRegex(ctx context.Context, regex string) (isMatching bool, err error)
- func (t *TmuxWindow) ListWindowNames(ctx context.Context) (windowNames []string, err error)
- func (t *TmuxWindow) Recreate(ctx context.Context) (err error)
- func (t *TmuxWindow) RunCommand(ctx context.Context, runCommandOptions *parameteroptions.RunCommandOptions) (commandOutput *commandoutput.CommandOutput, err error)
- func (t *TmuxWindow) SendKeys(ctx context.Context, toSend []string) (err error)
- func (t *TmuxWindow) SetName(name string) (err error)
- func (t *TmuxWindow) SetSession(session *TmuxSession) (err error)
- func (t *TmuxWindow) WaitUntilCliPromptReady(ctx context.Context) (err error)
- func (t *TmuxWindow) WaitUntilOutputMatchesRegex(ctx context.Context, regex string, timeout time.Duration) (err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTmuxWindowCliPromptNotReady = errors.New("tmux window CLI promptnot ready")
Functions ¶
Types ¶
type TmuxService ¶
type TmuxService struct {
// contains filtered or unexported fields
}
func GetTmuxOnLocalMachine ¶
func GetTmuxOnLocalMachine() (tmux *TmuxService, err error)
func NewTmuxService ¶
func NewTmuxService() (t *TmuxService)
func (*TmuxService) GetCommandExecutor ¶
func (t *TmuxService) GetCommandExecutor() (commandExecutor commandexecutorinterfaces.CommandExecutor, err error)
func (*TmuxService) GetSessionByName ¶
func (t *TmuxService) GetSessionByName(name string) (tmuxSession *TmuxSession, err error)
func (*TmuxService) GetWindowByNames ¶
func (t *TmuxService) GetWindowByNames(sessionName string, windowName string) (window *TmuxWindow, err error)
func (*TmuxService) ListSessionNames ¶
func (t *TmuxService) ListSessionNames(ctx context.Context) (sessionNames []string, err error)
func (*TmuxService) SetCommandExecutor ¶
func (t *TmuxService) SetCommandExecutor(commandExecutor commandexecutorinterfaces.CommandExecutor) (err error)
type TmuxSession ¶
type TmuxSession struct {
// contains filtered or unexported fields
}
func NewTmuxSession ¶
func NewTmuxSession() (t *TmuxSession)
func (*TmuxSession) Exists ¶
func (t *TmuxSession) Exists(ctx context.Context) (exists bool, err error)
func (*TmuxSession) GetCommandExecutor ¶
func (t *TmuxSession) GetCommandExecutor() (commandExecutor commandexecutorinterfaces.CommandExecutor, err error)
func (*TmuxSession) GetName ¶
func (t *TmuxSession) GetName() (name string, err error)
func (*TmuxSession) GetTmux ¶
func (t *TmuxSession) GetTmux() (tmux *TmuxService, err error)
func (*TmuxSession) GetWindowByName ¶
func (t *TmuxSession) GetWindowByName(windowName string) (window *TmuxWindow, err error)
func (*TmuxSession) ListWindowNames ¶
func (t *TmuxSession) ListWindowNames(ctx context.Context) (windowsNames []string, err error)
func (*TmuxSession) SetName ¶
func (t *TmuxSession) SetName(name string) (err error)
func (*TmuxSession) SetTmux ¶
func (t *TmuxSession) SetTmux(tmux *TmuxService) (err error)
type TmuxWindow ¶
type TmuxWindow struct {
// contains filtered or unexported fields
}
func NewTmuxWindow ¶
func NewTmuxWindow() (t *TmuxWindow)
func (*TmuxWindow) DeleteSession ¶
func (t *TmuxWindow) DeleteSession(ctx context.Context) (err error)
Delete the tmux session this window belongs to. Will implicitly also kill this window but also any other window in the session.
func (*TmuxWindow) Exists ¶
func (t *TmuxWindow) Exists(ctx context.Context) (exists bool, err error)
func (*TmuxWindow) GetCommandExecutor ¶
func (t *TmuxWindow) GetCommandExecutor() (commandExecutor commandexecutorinterfaces.CommandExecutor, err error)
func (*TmuxWindow) GetLatestPaneLine ¶
func (t *TmuxWindow) GetLatestPaneLine() (paneLine string, err error)
func (*TmuxWindow) GetName ¶
func (t *TmuxWindow) GetName() (name string, err error)
func (*TmuxWindow) GetSecondLatestPaneLine ¶
func (t *TmuxWindow) GetSecondLatestPaneLine() (paneLine string, err error)
Since the latest line usually shows the command prompt this command can be used to receive the latest printed line.
func (*TmuxWindow) GetSession ¶
func (t *TmuxWindow) GetSession() (session *TmuxSession, err error)
func (*TmuxWindow) GetSessionAndWindowName ¶
func (t *TmuxWindow) GetSessionAndWindowName() (sessionName string, windowName string, err error)
func (*TmuxWindow) GetSessionName ¶
func (t *TmuxWindow) GetSessionName() (sessionName string, err error)
func (*TmuxWindow) GetShownLines ¶
func (t *TmuxWindow) GetShownLines() (lines []string, err error)
func (*TmuxWindow) GetShownOutput ¶
func (t *TmuxWindow) GetShownOutput() (output string, err error)
func (*TmuxWindow) IsOutputMatchingRegex ¶
func (*TmuxWindow) ListWindowNames ¶
func (t *TmuxWindow) ListWindowNames(ctx context.Context) (windowNames []string, err error)
func (*TmuxWindow) RunCommand ¶
func (t *TmuxWindow) RunCommand(ctx context.Context, runCommandOptions *parameteroptions.RunCommandOptions) (commandOutput *commandoutput.CommandOutput, err error)
func (*TmuxWindow) SendKeys ¶
func (t *TmuxWindow) SendKeys(ctx context.Context, toSend []string) (err error)
Default use case to send a command is using []string{"command to run", "enter"}. "enter" in this example is detected as enter key by tmux.
func (*TmuxWindow) SetName ¶
func (t *TmuxWindow) SetName(name string) (err error)
func (*TmuxWindow) SetSession ¶
func (t *TmuxWindow) SetSession(session *TmuxSession) (err error)
func (*TmuxWindow) WaitUntilCliPromptReady ¶
func (t *TmuxWindow) WaitUntilCliPromptReady(ctx context.Context) (err error)
func (*TmuxWindow) WaitUntilOutputMatchesRegex ¶
Click to show internal directories.
Click to hide internal directories.