gcmd

package
v0.0.0-...-bad6181 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChmodAddX

func ChmodAddX(filename string) error

func CommandExists

func CommandExists(cmd string) bool

CommandExists checks if command exists.

func ExecWaitPrintScreen

func ExecWaitPrintScreen(name string, arg ...string) error

will print screen

func ExecWaitReturn

func ExecWaitReturn(name string, arg ...string) ([]byte, error)

will not print screen

func RunScript

func RunScript(shellCommand string) ([]byte, error)

RunScript run shell script just like in the terminal. This function waits until the end of the command execution before returning the result.

func RunScripts

func RunScripts(scripts ...string) ([]byte, error)

RunScripts run shell scripts just like in the terminal.

Types

type BrowserCMD

type BrowserCMD struct {
}

func NewBrowser

func NewBrowser() *BrowserCMD

func (*BrowserCMD) OpenFile

func (b *BrowserCMD) OpenFile(path string) error

func (*BrowserCMD) OpenURL

func (b *BrowserCMD) OpenURL(url string) error

func (*BrowserCMD) OpenURLAppMode

func (b *BrowserCMD) OpenURLAppMode(url string) error

open in Chrome APP mode, no toolbar/buttons, just web page

type Cmd

type Cmd struct {
	// contains filtered or unexported fields
}

func New

func New() *Cmd

func (*Cmd) AsFunc

func (c *Cmd) AsFunc(name string, arg ...string) *Cmd

func (*Cmd) AsShell

func (c *Cmd) AsShell(cmdline string) *Cmd

func (*Cmd) Print

func (c *Cmd) Print(print bool) *Cmd

func (*Cmd) Ready

func (c *Cmd) Ready() *Runner

func (*Cmd) Wait

func (c *Cmd) Wait(wait bool, timeout time.Duration) *Cmd

type Cmder

type Cmder struct {
	// contains filtered or unexported fields
}

func StartCmder

func StartCmder(screenPrint bool, cmd string, arg ...string) *Cmder

func (*Cmder) GetPid

func (c *Cmder) GetPid() int32

func (*Cmder) GetResultOutput

func (c *Cmder) GetResultOutput() (string, error)

func (*Cmder) Kill

func (c *Cmder) Kill() error

func (*Cmder) Wait

func (c *Cmder) Wait() error

func (*Cmder) WaitWithTimeout

func (c *Cmder) WaitWithTimeout(timeout time.Duration) (execTimeout bool, execError error)

type Interact

type Interact struct {
	// contains filtered or unexported fields
}

func NewInteract

func NewInteract() *Interact

func (*Interact) Select

func (t *Interact) Select(label string, options ...string) (string, error)

type Runner

type Runner Cmd

func (*Runner) Go

func (c *Runner) Go() *Runner

func (*Runner) Kill

func (c *Runner) Kill() error

func (*Runner) Pid

func (c *Runner) Pid() int

func (*Runner) Result

func (c *Runner) Result() ([]byte, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL