remote

package
v1.4.10 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// ConnectionString - user@host for ssh command
	ConnectionString string

	// WaitInterval - run command every N seconds to check the output
	WaitInterval time.Duration

	// WaitTimeout - consider command to fail after this timeout exceeded
	WaitTimeout time.Duration
	// contains filtered or unexported fields
}

Client - wrapper to run bash commands over ssh

func NewClient

func NewClient(connectionString string, log *logrus.Entry) (*Client, error)

NewClient - create new SSH remote client

func (*Client) CopyFiles

func (c *Client) CopyFiles(from, to string) error

CopyFiles - copy local files to remote server

func (*Client) Exec

func (c *Client) Exec(cmd string) (string, error)

Exec - run command over ssh

func (*Client) ExecAndWaitRegExp

func (c *Client) ExecAndWaitRegExp(cmd string, re *regexp.Regexp, inverted bool) error

ExecAndWaitRegExp - wait command output to to satisfy regex or return error on timeout

func (*Client) String

func (c *Client) String() string

Jump to

Keyboard shortcuts

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