transport

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2022 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Local

type Local struct{}

Local the localhost fake object

func NewLocal

func NewLocal() (*Local, error)

NewLocal creates a new local object

func (*Local) Close

func (l *Local) Close()

Close fakes closing connection

func (*Local) Copy

func (l *Local) Copy(string, string, string) error

Copy fakes copy

func (*Local) Execute

func (l *Local) Execute(cmd string) (string, string, error)

Execute executes a command through SSH returns stdout, stderr, error

func (*Local) Mkdir

func (l *Local) Mkdir(string) error

Mkdir fakes mkdir

type SSH

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

SSH the ssh struct

func NewSSH

func NewSSH(host string, port string, user string, password string, keyfile string, timeout int, insecure bool) (*SSH, error)

NewSSH creates an SSH instance

func (*SSH) Close

func (t *SSH) Close()

Close closes the SSH session

func (*SSH) Copy

func (t *SSH) Copy(localPath string, remotePath string, rights string) error

Copy scp a file to the remote

func (*SSH) Execute

func (t *SSH) Execute(cmd string) (string, string, error)

Execute executes a command through SSH returns stdout, stderr, error

func (*SSH) Mkdir

func (t *SSH) Mkdir(remotePath string) error

Mkdir mkdir over ssh

type Transport

type Transport interface {
	Execute(string) (string, string, error)
	Copy(string, string, string) error
	Mkdir(string) error
	Close()
}

Transport the interface to transports

Jump to

Keyboard shortcuts

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