mos_test

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EventuallyConnects

func EventuallyConnects(user, pass, host string, t ...int)

func NewClient

func NewClient(user, pass, host string) (*ssh.Client, *ssh.Session, error)

NewClient returns a new ssh client associated to a machine

func NewSCPClient

func NewSCPClient(user, pass, host string) scp.Client

func RandStringRunes

func RandStringRunes(n int) string

func SSHCommand

func SSHCommand(user, pass, host, cmd string) (string, error)

func SSHDialTimeout

func SSHDialTimeout(network, addr string, config *ssh.ClientConfig, timeout time.Duration) (*ssh.Client, error)

SSHDialTimeout dials in SSH with a timeout. It sends periodic keepalives such as the remote host don't make the go client sit on Wait()

Types

type Conn

type Conn struct {
	net.Conn
	ReadTimeout  time.Duration
	WriteTimeout time.Duration
}

func (*Conn) Read

func (c *Conn) Read(b []byte) (int, error)

func (*Conn) Write

func (c *Conn) Write(b []byte) (int, error)

type SSHConn

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

func NewSSH

func NewSSH(user, pass, host string) *SSHConn

func (*SSHConn) Command

func (s *SSHConn) Command(cmd string) (out string, err error)

Jump to

Keyboard shortcuts

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