Documentation
¶
Index ¶
- func BB(s string) (b []byte)
- func CreateDirectory(dir string) bool
- func CreateDirectoryWithFileInfo(dir string) os.FileInfo
- func PrintLogs(_logs []string)
- func Run(ctx context.Context, bufferSize, retries int) error
- type Command
- type CommandOutput
- type Commander
- func (cmd *Commander) Compile(command string) *exec.Cmd
- func (cmd *Commander) Pipe(ctx context.Context, commands []UnsafeRawCommand, env []string, ...) (CommandOutput, bool)
- func (cmd *Commander) Run(ctx context.Context, rawCommand UnsafeRawCommand, env []string, ...) (CommandOutput, bool)
- func (cmd *Commander) RunInside(ctx context.Context, rawCommand UnsafeRawCommand, directory string, ...) (CommandOutput, bool)
- func (cmd *Commander) RunInsideWithInput(ctx context.Context, rawCommand UnsafeRawCommand, directory string, ...) (CommandOutput, bool)
- func (cmd *Commander) String() string
- type CtxKeyPipeRawCommand
- type LineWriter
- type PromptHistory
- func (p *PromptHistory) AddCommand(rawCmd UnsafeRawCommand)
- func (p *PromptHistory) AddRuntime(dur time.Duration)
- func (p *PromptHistory) AddStdout(stdout []byte)
- func (p *PromptHistory) Run(ctx context.Context, rawCmd string, sem sema.Semaphore, env []string, ...) (CommandOutput, bool)
- func (p *PromptHistory) RunInside(ctx context.Context, rawCmd string, sem sema.Semaphore, directory string, ...) (CommandOutput, bool)
- func (p *PromptHistory) RunInsideWithInput(ctx context.Context, rawCmd string, sem sema.Semaphore, directory string, ...) (CommandOutput, bool)
- func (p *PromptHistory) RunWithInput(ctx context.Context, rawCmd string, rawInput string, env []string, ...) (CommandOutput, bool)
- func (p *PromptHistory) String() (out string)
- func (p *PromptHistory) TraceIt(command string) (err error)
- type UnsafeRawCommand
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDirectory ¶
Types ¶
type CommandOutput ¶
type Commander ¶
func (*Commander) Pipe ¶
func (cmd *Commander) Pipe(ctx context.Context, commands []UnsafeRawCommand, env []string, handler func(CommandOutput) bool) (CommandOutput, bool)
func (*Commander) Run ¶
func (cmd *Commander) Run(ctx context.Context, rawCommand UnsafeRawCommand, env []string, handler func(CommandOutput) bool) (CommandOutput, bool)
func (*Commander) RunInside ¶
func (cmd *Commander) RunInside(ctx context.Context, rawCommand UnsafeRawCommand, directory string, env []string, handler func(CommandOutput) bool) (CommandOutput, bool)
func (*Commander) RunInsideWithInput ¶
func (cmd *Commander) RunInsideWithInput(ctx context.Context, rawCommand UnsafeRawCommand, directory string, input string, env []string, handler func(CommandOutput) bool) (CommandOutput, bool)
type CtxKeyPipeRawCommand ¶
type CtxKeyPipeRawCommand string
type LineWriter ¶
type LineWriter struct {
// contains filtered or unexported fields
}
func NewLineWriter ¶
func NewLineWriter(size int) *LineWriter
func (*LineWriter) Close ¶
func (lw *LineWriter) Close()
func (*LineWriter) Err ¶
func (lw *LineWriter) Err() error
func (*LineWriter) Lines ¶
func (lw *LineWriter) Lines() <-chan string
func (*LineWriter) ReadLine ¶
func (lw *LineWriter) ReadLine() (string, error)
type PromptHistory ¶
type PromptHistory struct { Commands []string Runtimes []time.Duration Outputs [][]byte // contains filtered or unexported fields }
func Prompt ¶
func Prompt() *PromptHistory
func (*PromptHistory) AddCommand ¶
func (p *PromptHistory) AddCommand(rawCmd UnsafeRawCommand)
func (*PromptHistory) AddRuntime ¶
func (p *PromptHistory) AddRuntime(dur time.Duration)
func (*PromptHistory) AddStdout ¶
func (p *PromptHistory) AddStdout(stdout []byte)
func (*PromptHistory) Run ¶
func (p *PromptHistory) Run(ctx context.Context, rawCmd string, sem sema.Semaphore, env []string, handler func(CommandOutput) bool) (CommandOutput, bool)
func (*PromptHistory) RunInside ¶
func (p *PromptHistory) RunInside(ctx context.Context, rawCmd string, sem sema.Semaphore, directory string, env []string, handler func(CommandOutput) bool) (CommandOutput, bool)
func (*PromptHistory) RunInsideWithInput ¶
func (p *PromptHistory) RunInsideWithInput(ctx context.Context, rawCmd string, sem sema.Semaphore, directory string, input string, env []string, handler func(CommandOutput) bool) (CommandOutput, bool)
func (*PromptHistory) RunWithInput ¶
func (p *PromptHistory) RunWithInput(ctx context.Context, rawCmd string, rawInput string, env []string, handler func(CommandOutput) bool) (CommandOutput, bool)
func (*PromptHistory) String ¶
func (p *PromptHistory) String() (out string)
func (*PromptHistory) TraceIt ¶
func (p *PromptHistory) TraceIt(command string) (err error)
type UnsafeRawCommand ¶
type UnsafeRawCommand string
Click to show internal directories.
Click to hide internal directories.