Documentation ¶
Index ¶
- Constants
- func CopyIOAndUpdateSessionDeadline(dst io.Writer, src io.Reader, session *SshSession) (written int64, err error)
- func UploadFile(hostname, sourceFile, targetFile string) (stdout, stderr string, err error)
- type ForwardConfig
- type LocalForwardServer
- type PtyInfo
- type ReadWriteCloser
- type SSHClient
- func (c *SSHClient) Cmd(cmd string, sn *SshSession, deadline *time.Time, idleTimeout int) (output, errput string, currentSession *SshSession, err error)
- func (c *SSHClient) Connect() (conn *ssh.Client, err error)
- func (c *SSHClient) Pipe(rw ReadWriteCloser, pty *PtyInfo, deadline *time.Time, idleTimeout int) (currentSession *SshSession, err error)
- func (c *SSHClient) TransferData(target string, data []byte) (stdout, stderr string, err error)
- type SSHClientConfig
- type SshSession
- func ExecuteCmd(cmd, hostname string) (output, errput string, currentSession *SshSession, err error)
- func NewSession(conn *ssh.Client, deadline *time.Time, idleTimeout int) (ss *SshSession, err error)
- func NewSessionWithChannel(conn *ssh.Client, ch ssh.Channel, deadline *time.Time, idleTimeout int) (ss *SshSession, err error)
- func (sc *SshSession) Close() error
- func (sc *SshSession) RequestPty(term string, h int, w int, termmodes ssh.TerminalModes) (err error)
- func (sc *SshSession) Run(cmd string) (err error)
- func (sc *SshSession) SetDeadline(deadline *time.Time)
- func (sc *SshSession) Shell() error
- func (sc *SshSession) StderrPipe() (io.Reader, error)
- func (sc *SshSession) StdinPipe() (io.WriteCloser, error)
- func (sc *SshSession) StdoutPipe() (io.Reader, error)
- func (sc *SshSession) Wait() error
- type Tunnel
- type UUID
Constants ¶
View Source
const ( DEFAULT_CHUNK_SIZE = 65536 MIN_CHUNKS = 10 THROUGHPUT_SLEEP_INTERVAL = 100 MIN_THROUGHPUT = DEFAULT_CHUNK_SIZE * MIN_CHUNKS * (1000 / THROUGHPUT_SLEEP_INTERVAL) )
View Source
const ( VINTR = 1 VQUIT = 2 VERASE = 3 VKILL = 4 VEOF = 5 VEOL = 6 VEOL2 = 7 VSTART = 8 VSTOP = 9 VSUSP = 10 VDSUSP = 11 VREPRINT = 12 VWERASE = 13 VLNEXT = 14 VFLUSH = 15 VSWTCH = 16 VSTATUS = 17 VDISCARD = 18 IGNPAR = 30 PARMRK = 31 INPCK = 32 ISTRIP = 33 INLCR = 34 IGNCR = 35 ICRNL = 36 IUCLC = 37 IXON = 38 IXANY = 39 IXOFF = 40 IMAXBEL = 41 ISIG = 50 ICANON = 51 XCASE = 52 ECHO = 53 ECHOE = 54 ECHOK = 55 ECHONL = 56 NOFLSH = 57 TOSTOP = 58 IEXTEN = 59 ECHOCTL = 60 ECHOKE = 61 PENDIN = 62 OPOST = 70 OLCUC = 71 ONLCR = 72 OCRNL = 73 ONOCR = 74 ONLRET = 75 CS7 = 90 CS8 = 91 PARENB = 92 PARODD = 93 TTY_OP_ISPEED = 128 TTY_OP_OSPEED = 129 )
POSIX terminal mode flags as listed in RFC 4254 Section 8.
Variables ¶
This section is empty.
Functions ¶
func UploadFile ¶
Types ¶
type ForwardConfig ¶
type LocalForwardServer ¶
type LocalForwardServer struct { ForwardConfig // contains filtered or unexported fields }
func (*LocalForwardServer) Start ¶
func (this *LocalForwardServer) Start(call func())
func (*LocalForwardServer) Stop ¶
func (this *LocalForwardServer) Stop()
type ReadWriteCloser ¶
type ReadWriteCloser interface { io.Reader io.WriteCloser }
type SSHClient ¶
type SSHClient struct { SSHClientConfig // contains filtered or unexported fields }
func NewSSHClient ¶
func NewSSHClient(config *SSHClientConfig) (client *SSHClient)
func (*SSHClient) Cmd ¶
func (c *SSHClient) Cmd(cmd string, sn *SshSession, deadline *time.Time, idleTimeout int) (output, errput string, currentSession *SshSession, err error)
func (*SSHClient) Pipe ¶
func (c *SSHClient) Pipe(rw ReadWriteCloser, pty *PtyInfo, deadline *time.Time, idleTimeout int) (currentSession *SshSession, err error)
type SSHClientConfig ¶
type SshSession ¶
type SshSession struct { Stdout *bytes.Buffer Stderr *bytes.Buffer // contains filtered or unexported fields }
func ExecuteCmd ¶
func ExecuteCmd(cmd, hostname string) (output, errput string, currentSession *SshSession, err error)
func NewSession ¶
func NewSessionWithChannel ¶
func (*SshSession) Close ¶
func (sc *SshSession) Close() error
func (*SshSession) RequestPty ¶
func (sc *SshSession) RequestPty(term string, h int, w int, termmodes ssh.TerminalModes) (err error)
func (*SshSession) Run ¶
func (sc *SshSession) Run(cmd string) (err error)
func (*SshSession) SetDeadline ¶
func (sc *SshSession) SetDeadline(deadline *time.Time)
func (*SshSession) Shell ¶
func (sc *SshSession) Shell() error
func (*SshSession) StderrPipe ¶
func (sc *SshSession) StderrPipe() (io.Reader, error)
func (*SshSession) StdinPipe ¶
func (sc *SshSession) StdinPipe() (io.WriteCloser, error)
func (*SshSession) StdoutPipe ¶
func (sc *SshSession) StdoutPipe() (io.Reader, error)
func (*SshSession) Wait ¶
func (sc *SshSession) Wait() error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.