exec

package
v0.0.0-...-484cd83 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeTimeout  = 124
	CodeIOError  = 125
	CodeLookup   = 127
	CodeOutRange = 255
)

Variables

This section is empty.

Functions

func WebServiceV1Alpha1

func WebServiceV1Alpha1(urlStr string) (*restful.WebService, error)

Types

type Cmd

type Cmd struct {
	Path string
	Args []string `in:"query=args"`
	Env  []string `in:"query=env"`
	Dir  string   `in:"query=dir"`
}

type CmdResource

type CmdResource struct {
	*SSHCmd
}

func (*CmdResource) WebServiceV1Alpha1

func (r *CmdResource) WebServiceV1Alpha1() *restful.WebService

type Result

type Result struct {
	Stdout string `json:"stdout"`
	Stderr string `json:"stderr"`
	Code   int    `json:"code"`
}

type SSHCmd

type SSHCmd struct {
	*ssh.Client
}

func OpenSSHCmd

func OpenSSHCmd(urlStr string) (*SSHCmd, error)

func (*SSHCmd) Close

func (c *SSHCmd) Close() error

func (*SSHCmd) Open

func (c *SSHCmd) Open(urlStr string) error

func (*SSHCmd) Run

func (c *SSHCmd) Run(ctx context.Context, cmd *Cmd) (*Result, error)

Jump to

Keyboard shortcuts

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