Documentation ¶
Index ¶
- func Iscmderror(err error) bool
- func Isssherror(err error) bool
- type Cmderror
- type Goshnix
- func (goshnix *Goshnix) Chmod(name string, mode os.FileMode) error
- func (goshnix *Goshnix) Chown(name string, uid, gid int) error
- func (goshnix *Goshnix) Environ() ([]string, error)
- func (goshnix *Goshnix) Getenv(key string) (string, error)
- func (goshnix *Goshnix) Hostname() (name string, err error)
- func (goshnix *Goshnix) Kill(pid int) error
- func (goshnix *Goshnix) Link(oldname, newname string) error
- func (goshnix *Goshnix) LookupEnv(key string) (string, bool, error)
- func (goshnix *Goshnix) Mkdir(name string, perm os.FileMode) error
- func (goshnix *Goshnix) ReadDir(dirname string) ([]os.FileInfo, error)
- func (goshnix *Goshnix) ReadFile(filename string) ([]byte, error)
- func (goshnix *Goshnix) Readlink(name string) (string, error)
- func (goshnix *Goshnix) Remove(name string) error
- func (goshnix *Goshnix) RemoveAll(path string) error
- func (goshnix *Goshnix) Rename(oldpath, newpath string) error
- func (goshnix *Goshnix) Setenv(key, value string) error
- func (goshnix *Goshnix) Stat(name string) (os.FileInfo, error)
- func (goshnix *Goshnix) Symlink(oldname, newname string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Iscmderror ¶
Iscmderror check if error is due to command execution failed
func Isssherror ¶
Isssherror check if error is due to any ssh connection error
Types ¶
type Goshnix ¶
type Goshnix struct {
// contains filtered or unexported fields
}
The Goshnix lib client
func (*Goshnix) Chmod ¶
Chmod changes the mode of the named file to mode. If the file is a symbolic link, it changes the mode of the link's target
func (*Goshnix) Chown ¶
Chown changes the numeric uid and gid of the named file. If the file is a symbolic link, it changes the uid and gid of the link's target
func (*Goshnix) Environ ¶
Environ returns a copy of strings representing the environment, in the form "key=value"
func (*Goshnix) Getenv ¶
Getenv retrieves the value of the environment variable named by the key. It returns the value, which will be empty if the variable is not present
func (*Goshnix) LookupEnv ¶
LookupEnv retrieves the value of the environment variable named by the key. If the variable is present in the environment the value (which may be empty) is returned and the boolean is true
func (*Goshnix) ReadDir ¶
ReadDir reads the directory named by dirname and returns a list of directory entries sorted by filename
func (*Goshnix) ReadFile ¶
ReadFile reads the file named by filename and returns the contents. A successful call returns err == nil, not err == EOF. Because ReadFile reads the whole file, it does not treat an EOF from Read as an error to be reported.
func (*Goshnix) RemoveAll ¶
RemoveAll removes path and any children it contains. It removes everything it can but returns the first error it encounters
func (*Goshnix) Rename ¶
Rename renames (moves) oldpath to newpath. If newpath already exists, Rename replaces it. OS-specific restrictions may apply when oldpath and newpath are in different directories
func (*Goshnix) Setenv ¶
Setenv sets the value of the environment variable named by the key (TODO: As the ssh session is new each time, it could make the Setenv useless)