Documentation ¶
Index ¶
- Variables
- func Command(name string, arg ...string) string
- func Dir(path string) string
- func Exists(path string) bool
- func FileName(path string) string
- func NewConfig(isLocal bool, host string, user string, password string, port uint16) config
- func SimpleConfig(host string) config
- type FileInfo
- type LocalSession
- func (s *LocalSession) Close() error
- func (s *LocalSession) CombinedOutput(name string, arg ...string) ([]byte, error)
- func (s *LocalSession) Connect() error
- func (s *LocalSession) Create(name string) error
- func (s *LocalSession) Exists(path string) (bool, error)
- func (s *LocalSession) IsLinux() bool
- func (s *LocalSession) IsLocal() bool
- func (s *LocalSession) Log(body cmdLogBody)
- func (s *LocalSession) MakeDirAll(path string, perm os.FileMode) error
- func (s *LocalSession) Output(name string, arg ...string) ([]byte, error)
- func (s *LocalSession) OutputGrep(cmdList []struct{ ... }) ([]byte, error)
- func (s *LocalSession) ReadDir(dir string) ([]FileInfo, error)
- func (s *LocalSession) ReadFile(fileName string) ([]byte, error)
- func (s *LocalSession) Remove(name string) error
- func (s *LocalSession) RemoveAll(path string) error
- func (s *LocalSession) Run(name string, arg ...string) error
- func (s *LocalSession) WriteString(name string, data string, mode ...string) error
- type RemoteSession
- func (c *RemoteSession) AddLocalHost(host string)
- func (s *RemoteSession) Close() error
- func (s *RemoteSession) CombinedOutput(name string, arg ...string) ([]byte, error)
- func (s *RemoteSession) Connect() error
- func (s *RemoteSession) Create(name string) error
- func (s *RemoteSession) Exists(path string) (bool, error)
- func (c *RemoteSession) Host() string
- func (s *RemoteSession) IsLinux() bool
- func (s *RemoteSession) IsLocal() bool
- func (s *RemoteSession) Log(body cmdLogBody)
- func (s *RemoteSession) MakeDirAll(path string, perm os.FileMode) error
- func (s *RemoteSession) Output(name string, arg ...string) ([]byte, error)
- func (s *RemoteSession) OutputGrep(cmdList []struct{ ... }) ([]byte, error)
- func (c *RemoteSession) Password() string
- func (c *RemoteSession) Port() uint16
- func (s *RemoteSession) ReadDir(dir string) ([]FileInfo, error)
- func (s *RemoteSession) ReadFile(fileName string) ([]byte, error)
- func (s *RemoteSession) Remove(name string) error
- func (s *RemoteSession) RemoveAll(path string) error
- func (s *RemoteSession) Run(name string, arg ...string) error
- func (c *RemoteSession) User() string
- func (s *RemoteSession) WriteString(name string, data string, mode ...string) error
- type Session
- type SingleSession
- func (c SingleSession) Close() error
- func (c SingleSession) CombinedOutput(name string, arg ...string) ([]byte, error)
- func (c SingleSession) Connect() error
- func (c SingleSession) Create(name string) error
- func (c SingleSession) Exists(path string) (bool, error)
- func (c SingleSession) IsLocal() bool
- func (c SingleSession) MakeDirAll(path string, perm os.FileMode) error
- func (c SingleSession) Output(name string, arg ...string) ([]byte, error)
- func (c SingleSession) OutputGrep(cmdList []struct{ ... }) ([]byte, error)
- func (c SingleSession) ReadDir(dir string) ([]FileInfo, error)
- func (c SingleSession) ReadFile(fileName string) ([]byte, error)
- func (c SingleSession) Remove(name string) error
- func (c SingleSession) RemoveAll(path string) error
- func (c SingleSession) Run(name string, arg ...string) error
- func (c SingleSession) WriteString(name string, data string, mode ...string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNilSshClient = errors.New("ssh client is nil") ErrNilFileHandler = errors.New("create ssh sessionCmd failed, file handler is nil") )
Functions ¶
func SimpleConfig ¶
func SimpleConfig(host string) config
Types ¶
type LocalSession ¶
type LocalSession struct {
// contains filtered or unexported fields
}
func (*LocalSession) Close ¶
func (s *LocalSession) Close() error
func (*LocalSession) CombinedOutput ¶
func (s *LocalSession) CombinedOutput(name string, arg ...string) ([]byte, error)
func (*LocalSession) Connect ¶
func (s *LocalSession) Connect() error
func (*LocalSession) Create ¶
func (s *LocalSession) Create(name string) error
func (*LocalSession) IsLinux ¶
func (s *LocalSession) IsLinux() bool
func (*LocalSession) IsLocal ¶
func (s *LocalSession) IsLocal() bool
func (*LocalSession) Log ¶ added in v1.1.0
func (s *LocalSession) Log(body cmdLogBody)
func (*LocalSession) MakeDirAll ¶
func (s *LocalSession) MakeDirAll(path string, perm os.FileMode) error
func (*LocalSession) Output ¶
func (s *LocalSession) Output(name string, arg ...string) ([]byte, error)
func (*LocalSession) OutputGrep ¶
func (s *LocalSession) OutputGrep(cmdList []struct { name string arg []string }) ([]byte, error)
func (*LocalSession) Remove ¶
func (s *LocalSession) Remove(name string) error
func (*LocalSession) RemoveAll ¶
func (s *LocalSession) RemoveAll(path string) error
func (*LocalSession) WriteString ¶
func (s *LocalSession) WriteString(name string, data string, mode ...string) error
type RemoteSession ¶
func (*RemoteSession) AddLocalHost ¶ added in v1.1.0
func (c *RemoteSession) AddLocalHost(host string)
func (*RemoteSession) Close ¶
func (s *RemoteSession) Close() error
func (*RemoteSession) CombinedOutput ¶
func (s *RemoteSession) CombinedOutput(name string, arg ...string) ([]byte, error)
func (*RemoteSession) Connect ¶
func (s *RemoteSession) Connect() error
func (*RemoteSession) Create ¶
func (s *RemoteSession) Create(name string) error
func (*RemoteSession) IsLinux ¶
func (s *RemoteSession) IsLinux() bool
func (*RemoteSession) IsLocal ¶
func (s *RemoteSession) IsLocal() bool
func (*RemoteSession) Log ¶ added in v1.1.0
func (s *RemoteSession) Log(body cmdLogBody)
func (*RemoteSession) MakeDirAll ¶
func (s *RemoteSession) MakeDirAll(path string, perm os.FileMode) error
func (*RemoteSession) Output ¶
func (s *RemoteSession) Output(name string, arg ...string) ([]byte, error)
func (*RemoteSession) OutputGrep ¶
func (s *RemoteSession) OutputGrep(cmdList []struct { name string arg []string }) ([]byte, error)
func (*RemoteSession) Remove ¶
func (s *RemoteSession) Remove(name string) error
func (*RemoteSession) RemoveAll ¶
func (s *RemoteSession) RemoveAll(path string) error
func (*RemoteSession) WriteString ¶
func (s *RemoteSession) WriteString(name string, data string, mode ...string) error
type Session ¶
type Session interface {
// contains filtered or unexported methods
}
func NewSession ¶
func NewSingleSession ¶
type SingleSession ¶
func (SingleSession) Close ¶
func (c SingleSession) Close() error
func (SingleSession) CombinedOutput ¶
func (c SingleSession) CombinedOutput(name string, arg ...string) ([]byte, error)
func (SingleSession) Connect ¶
func (c SingleSession) Connect() error
func (SingleSession) Create ¶
func (c SingleSession) Create(name string) error
func (SingleSession) IsLocal ¶
func (c SingleSession) IsLocal() bool
func (SingleSession) MakeDirAll ¶
func (c SingleSession) MakeDirAll(path string, perm os.FileMode) error
func (SingleSession) Output ¶
func (c SingleSession) Output(name string, arg ...string) ([]byte, error)
func (SingleSession) OutputGrep ¶
func (c SingleSession) OutputGrep(cmdList []struct { name string arg []string }) ([]byte, error)
func (SingleSession) Remove ¶
func (c SingleSession) Remove(name string) error
func (SingleSession) RemoveAll ¶
func (c SingleSession) RemoveAll(path string) error
func (SingleSession) WriteString ¶
func (c SingleSession) WriteString(name string, data string, mode ...string) error
Click to show internal directories.
Click to hide internal directories.