Documentation
¶
Index ¶
- Variables
- func Exec(ctx context.Context, command string, options contracts.ExecutorOptions) ([]byte, int, error)
- func ExecWithWriter(ctx context.Context, command string, out io.Writer, ...) (int, error)
- type CommandHandler
- type CommandsHandlers
- type Executor
- type ExtendableExecutor
- func (executor *ExtendableExecutor) Exec(ctx context.Context, command string, options contracts.ExecutorOptions) ([]byte, int, error)
- func (executor *ExtendableExecutor) ExecWithWriter(ctx context.Context, command string, out io.Writer, ...) (int, error)
- func (executor *ExtendableExecutor) RegisterHandler(command string, handler CommandHandler)
- type SafeBuffer
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEmptyCommand = errors.New("empty command")
View Source
var ErrInvalidCommand = errors.New("invalid command")
Functions ¶
Types ¶
type CommandHandler ¶
type CommandsHandlers ¶
type CommandsHandlers map[string]CommandHandler
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
func NewCleanExecutor ¶
func NewCleanExecutor() *Executor
NewCleanExecutor returns a new executor. This configuration of executor will not append command and exit code to the output.
func NewExecutor ¶
func NewExecutor() *Executor
NewExecutor returns a new executor. This configuration of executor will append command and exit code to the output.
type ExtendableExecutor ¶
type ExtendableExecutor struct {
// contains filtered or unexported fields
}
func NewDefaultExtendableExecutor ¶
func NewDefaultExtendableExecutor(executor contracts.Executor) *ExtendableExecutor
func (*ExtendableExecutor) Exec ¶
func (executor *ExtendableExecutor) Exec( ctx context.Context, command string, options contracts.ExecutorOptions, ) ([]byte, int, error)
func (*ExtendableExecutor) ExecWithWriter ¶
func (executor *ExtendableExecutor) ExecWithWriter( ctx context.Context, command string, out io.Writer, options contracts.ExecutorOptions, ) (int, error)
func (*ExtendableExecutor) RegisterHandler ¶
func (executor *ExtendableExecutor) RegisterHandler(command string, handler CommandHandler)
type SafeBuffer ¶
type SafeBuffer struct {
// contains filtered or unexported fields
}
SafeBuffer is a goroutine safe bytes.Buffer.
func NewSafeBuffer ¶
func NewSafeBuffer() *SafeBuffer
func (*SafeBuffer) String ¶
func (s *SafeBuffer) String() string
String returns the contents of the unread portion of the buffer as a string. If the buffer is a nil pointer, it returns "<nil>".
Source Files
¶
Click to show internal directories.
Click to hide internal directories.