sshutil

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2025 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const LINUX = "linux"
View Source
const MAX_RETRIES = 3
View Source
const RAND_STR_LEN = 6
View Source
const WINDOWS = "windows"

Variables

This section is empty.

Functions

func CreateTempDir

func CreateTempDir(client *Client) (tempPath string, err error)

Types

type Alias

type Alias string

func (Alias) GetAddress

func (alias Alias) GetAddress() (address string)

func (Alias) GetAuth

func (alias Alias) GetAuth() (auth goph.Auth, err error)

func (Alias) GetPort

func (alias Alias) GetPort() (port uint, err error)

func (Alias) GetUser

func (alias Alias) GetUser() (username string, err error)

type Client

type Client struct {
	*goph.Client
	// contains filtered or unexported fields
}

func NewConn

func NewConn(alias Alias) (client *Client, err error)

func (Client) Close

func (c Client) Close() error

func (Client) Command

func (c Client) Command(name string, args ...string) (*goph.Cmd, error)

func (Client) CommandContext

func (c Client) CommandContext(ctx context.Context, name string, args ...string) (*goph.Cmd, error)

func (Client) DetermineClientDetails

func (c Client) DetermineClientDetails() (err error)

func (Client) Download

func (c Client) Download(remotePath string, localPath string) (err error)

func (Client) GetArch

func (c Client) GetArch() string

func (Client) GetOS

func (c Client) GetOS() string

func (Client) GetOSTempDir

func (c Client) GetOSTempDir() (tempDir string, err error)

func (Client) JoinPath

func (c Client) JoinPath(paths ...string) string

func (Client) Mkdir

func (c Client) Mkdir(path string) (err error)

func (Client) NewSftp

func (c Client) NewSftp(opts ...sftp.ClientOption) (*sftp.Client, error)

func (Client) Rmdir

func (c Client) Rmdir(path string) (err error)

func (Client) Rmrf

func (c Client) Rmrf(path string) (err error)

func (Client) Run

func (c Client) Run(cmd string) ([]byte, error)

func (Client) RunContext

func (c Client) RunContext(ctx context.Context, name string) ([]byte, error)

func (Client) Upload

func (c Client) Upload(localPath string, remotePath string) (err error)

type ClientDetails

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

Jump to

Keyboard shortcuts

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