sshclient

package
v0.0.0-...-fcc202b Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PublicKeyFile

func PublicKeyFile(file string) (ssh.AuthMethod, error)

Types

type Client

type Client struct {
	SshClient *ssh.Client
	Hostname  string
	Addr      string
}

func NewClient

func NewClient(ip, user, pass string, port int, skey bool, hostname string) (*Client, error)

func (*Client) Close

func (this *Client) Close()

func (*Client) Copy

func (c *Client) Copy(src, dest string, mode string) error

func (*Client) CopyFile

func (c *Client) CopyFile(fileReader io.Reader, remotePath string, permissions string) error

func (*Client) Execute

func (this *Client) Execute(module, cmd string) error

func (*Client) Run

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

type CopyFile

type CopyFile struct {
	Src    string
	Dest   string
	Mode   string
	Force  bool
	Backup bool
	User   string
	Group  string
}

func NewCopyFile

func NewCopyFile() *CopyFile

func (*CopyFile) Parse

func (c *CopyFile) Parse(str string) error

type SftpClient

type SftpClient struct {
	Client
	Sftpclient sftp.Client
}

func Sftpinit

func Sftpinit() *SftpClient

func (*SftpClient) Copy

func (c *SftpClient) Copy(src, dst string)

Jump to

Keyboard shortcuts

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