Documentation ¶
Index ¶
- Variables
- type BashStrategy
- type CmdStrategy
- type Host
- type HostOption
- func WithArgs(args []string) HostOption
- func WithCwd(dir string) HostOption
- func WithEncoding(encoding encoding.Encoding) HostOption
- func WithEnv(env []string) HostOption
- func WithRawArgs(args []string) HostOption
- func WithRawEnv(env []string) HostOption
- func WithStderr(output io.Writer) HostOption
- func WithStdout(output io.Writer) HostOption
- type PowershellStrategy
- func (s *PowershellStrategy) ArgsWrapper(args []string) []string
- func (s *PowershellStrategy) EnvWrapper(env []string) []string
- func (s *PowershellStrategy) GetCommand(ctx context.Context) *exec.Cmd
- func (s *PowershellStrategy) GetEncoding() encoding.Encoding
- func (s *PowershellStrategy) GetName() string
- type Strategy
Constants ¶
This section is empty.
Variables ¶
var Default = Bash
Functions ¶
This section is empty.
Types ¶
type BashStrategy ¶
type BashStrategy struct{}
func Bash ¶
func Bash() *BashStrategy
func (*BashStrategy) ArgsWrapper ¶
func (s *BashStrategy) ArgsWrapper(args []string) []string
func (*BashStrategy) EnvWrapper ¶
func (s *BashStrategy) EnvWrapper(env []string) []string
func (*BashStrategy) GetCommand ¶
func (s *BashStrategy) GetCommand(ctx context.Context) *exec.Cmd
func (*BashStrategy) GetEncoding ¶
func (s *BashStrategy) GetEncoding() encoding.Encoding
func (*BashStrategy) GetName ¶
func (s *BashStrategy) GetName() string
type CmdStrategy ¶
type CmdStrategy struct{}
func Cmd ¶
func Cmd() *CmdStrategy
func (*CmdStrategy) ArgsWrapper ¶
func (s *CmdStrategy) ArgsWrapper(args []string) []string
func (*CmdStrategy) EnvWrapper ¶
func (s *CmdStrategy) EnvWrapper(env []string) []string
func (*CmdStrategy) GetCommand ¶
func (s *CmdStrategy) GetCommand(ctx context.Context) *exec.Cmd
func (*CmdStrategy) GetEncoding ¶
func (s *CmdStrategy) GetEncoding() encoding.Encoding
func (*CmdStrategy) GetName ¶
func (s *CmdStrategy) GetName() string
type Host ¶
type Host struct {
// contains filtered or unexported fields
}
Host is shell host structure to communicate with shell process.
func NewHost ¶
func NewHost(ctx context.Context, strategy Strategy, options ...HostOption) *Host
NewHost creates new shell host based on passed strategy.
type HostOption ¶
func WithArgs ¶
func WithArgs(args []string) HostOption
WithArgs setups arguments (ShellStrategy defined arguments will be included) for shell host.
func WithCwd ¶
func WithCwd(dir string) HostOption
WithCwd setups environment variables for shell host.
func WithEncoding ¶
func WithEncoding(encoding encoding.Encoding) HostOption
WithEncoding setups shell input/output encoding.
func WithEnv ¶
func WithEnv(env []string) HostOption
WithEnv setups environment variables (ShellStrategy defined variables will be included) for shell host.
func WithRawArgs ¶
func WithRawArgs(args []string) HostOption
WithRawArgs setups arguments (ShellStrategy defined arguments will not be included) for shell host.
func WithRawEnv ¶
func WithRawEnv(env []string) HostOption
WithRawEnv setups environment variables (ShellStrategy defined variables will not be included) for shell host.
func WithStderr ¶
func WithStderr(output io.Writer) HostOption
WithStderr setups Stderr writer for shell host.
func WithStdout ¶
func WithStdout(output io.Writer) HostOption
WithStdout setups Stdout writer for shell host.
type PowershellStrategy ¶
type PowershellStrategy struct{}
func PowerShell ¶
func PowerShell() *PowershellStrategy
func (*PowershellStrategy) ArgsWrapper ¶
func (s *PowershellStrategy) ArgsWrapper(args []string) []string
func (*PowershellStrategy) EnvWrapper ¶
func (s *PowershellStrategy) EnvWrapper(env []string) []string
func (*PowershellStrategy) GetCommand ¶
func (s *PowershellStrategy) GetCommand(ctx context.Context) *exec.Cmd
func (*PowershellStrategy) GetEncoding ¶
func (s *PowershellStrategy) GetEncoding() encoding.Encoding
func (*PowershellStrategy) GetName ¶
func (s *PowershellStrategy) GetName() string