command

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Name string
	// contains filtered or unexported fields
}

Command a command

func New

func New(name string, script string, runner Runner) *Command

New create a command

func (*Command) Exec

func (c *Command) Exec() ([]byte, error)

Exec run command

type Commander

type Commander interface {
	Exec() ([]byte, error)
}

Commander command interface

type LocalRunner

type LocalRunner struct{}

LocalRunner local runner

func NewLocalRunner

func NewLocalRunner() *LocalRunner

NewLocalRunner create a local runner

func (*LocalRunner) Run

func (l *LocalRunner) Run(script string) ([]byte, error)

Run script on local host

type RemoteRunner

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

RemoteRunner remote runner

func NewRemoteRunner

func NewRemoteRunner(sshClient ssh.Client) *RemoteRunner

NewRemoteRunner create a runner

func (*RemoteRunner) Run

func (r *RemoteRunner) Run(script string) ([]byte, error)

Run script on remote host

type Runner

type Runner interface {
	Run(script string) ([]byte, error)
}

Runner to exec command

Jump to

Keyboard shortcuts

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