Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
GracefulShutdownTimeout = time.Minute
)
Functions ¶
func ListenAndServe ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a base for building rcom base clients.
func NewClient ¶
func NewClient(opts ...ClientOption) *Client
NewClient returns new client with attributes set by given opts.
func (*Client) Execute ¶
func (c *Client) Execute(ctx context.Context, cmdArgs []string, files []fs.FileReader, resultFilePatterns ...string) (*Result, error)
Execute executes the service remotely with given arguments and returns a result. Method will panic if it is called when client allows execution of more then one commands, in that the ExecuteWithCommand should be used.
type ClientOption ¶
type ClientOption func(*Client)
ClientOption represents Client option.
func ClientWithCmds ¶
func ClientWithCmds(cmds ...string) ClientOption
WithHost sets Client.cmds attribute.
func ClientWithHost ¶
func ClientWithHost(host string) ClientOption
WithHost sets Client.host attribute.
func ClientWithPort ¶
func ClientWithPort(port uint16) ClientOption
WithPort sets Client.port attribute.
func ClientWithTimeOut ¶
func ClientWithTimeOut(timeout time.Duration) ClientOption
WithPort sets Client.timeout attribute.
type Command ¶
type Command struct { Name string Args []string Stdin []byte Files map[string][]byte ResultFilePatterns []string // NonErrorExitCodes are non zero exit codes that should be returned // as Result.ExitCode instead of being considered an error NonErrorExitCodes map[int]bool // contains filtered or unexported fields }
type Executer ¶
func LocalExecuter ¶
func LocalExecuter() Executer
type ExecuterFunc ¶
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
pkg
|
|
exec
Package exec is a replacement for os/exec and provides a Cmd struct that wraps os/exec.Cmd with additional builder design pattern methods and an option to kill sub processes.
|
Package exec is a replacement for os/exec and provides a Cmd struct that wraps os/exec.Cmd with additional builder design pattern methods and an option to kill sub processes. |
Click to show internal directories.
Click to hide internal directories.