Documentation
¶
Index ¶
- func Become(host *server.Host, in string) string
- func BecomeSCP(host *server.Host, in *scp.SCP) *scp.SCP
- type Backend
- type RemoteSession
- func (b *RemoteSession) Chmod(path string, mode int) (server.CmdErr, error)
- func (b *RemoteSession) Chown(path, u, g string) (server.CmdErr, error)
- func (b *RemoteSession) Close()
- func (b *RemoteSession) GetFileInfo(file string) (server.FileOwner, os.FileInfo, server.CmdErr, error)
- func (b *RemoteSession) MkDir(path string) (server.CmdErr, error)
- func (b *RemoteSession) ReadFile(name string) (os.FileInfo, []byte, server.CmdErr, error)
- func (b *RemoteSession) Run(cmd string, env map[string]string) (server.HostCommandResponse, error)
- func (b *RemoteSession) RunShellCommand(cmd string, env map[string]string) ([]byte, []byte, int, error)
- func (b *RemoteSession) WriteFile(name string, perms os.FileMode, content []byte) (server.CmdErr, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Backend ¶
Backend for a remote linux host
func (Backend) NewSession ¶
NewSession returns a new session to the host
type RemoteSession ¶
type RemoteSession struct { *ssh.Session Client *sshdial.Client Host *server.Host ServerSession server.Session }
RemoteSession is a wrapper around ssh session
func (*RemoteSession) Chown ¶
func (b *RemoteSession) Chown(path, u, g string) (server.CmdErr, error)
Chown changes file owner
func (*RemoteSession) GetFileInfo ¶
func (b *RemoteSession) GetFileInfo(file string) (server.FileOwner, os.FileInfo, server.CmdErr, error)
GetFileInfo retrieves file info from a host
func (*RemoteSession) MkDir ¶
func (b *RemoteSession) MkDir(path string) (server.CmdErr, error)
MkDir creates dir
func (*RemoteSession) Run ¶
func (b *RemoteSession) Run(cmd string, env map[string]string) (server.HostCommandResponse, error)
Run runs a command on a remote host via ssh
func (*RemoteSession) RunShellCommand ¶
func (b *RemoteSession) RunShellCommand(cmd string, env map[string]string) ([]byte, []byte, int, error)
RunShellCommand runs a command at a shell on the remote host. Returns the output and error
Click to show internal directories.
Click to hide internal directories.