# Functions
CompareAddr compares two addresses, if addr1 is equal to addr2, it returns 0 if addr1 is less than addr2, it returns -1 if addr1 is greater than addr2, it returns 1.
CompareIP compares two ip addresses, if ip1 is equal to ip2, it returns 0 if ip1 is less than ip2, it returns -1 if ip1 is greater than ip2, it returns 1.
ExecuteCommand is an alias of ExecuteCommandAndWait.
ExecuteCommandAndWait executes shell command and wait for it to complete.
ExecuteCommandNoWait executes shell command and does not wait for it to complete.
FindMountPoint returns the mount point of the given path, note that this function only works on unix-like system.
GetDefaultIP gets the default non-local ip, if there are more than one ips, it will return the first one.
GetFileNameDest returns the destination file name.
GetMinAddr gets the minimum address from the addr list.
GetPathDirMapLocal reads all subdirectories and files of given directory and calculate the relative path of rootPath, then map the absolute path of subdirectory names and file names as keys, relative paths as values to fileDirMap.
GetPidFromPidFile reads pid file and returns pid.
HandleSignals handles operating system signals.
IsDir returns if given path is a directory or not.
IsEmptyDir returns if given directory is empty or not.
IsRunningWithPid returns if given pid is running.
IsRunningWithPidFile returns if process of which pid was saved in given pid file is running.
IsValidIP checks if the ip is valid.
KillServer kills server with given pid, it acts like shell command "kill -9", it will also remove pid file if pid file path is specified as opts.
MatchMountPoint matches mount point of given path in the mount point slice, if nothing matched, it returns "/" as default mount point.
NewSSHConfig returns a new *SSHConfig.
NewSSHConfigWithDefault returns a new *SSHConfig with default values.
NewSSHConn returns a new *SSHConn.
PathExists returns if given path exists.
Readdir returns subdirectories and files of given directory on the remote host, it returns a slice of os.FileInfo.
No description provided by the author
SavePid saves pid to pid file with given file mode.
SendSignal sends signal to given pid, it will also remove pid file if pid file path is specified as opts.
ShutdownServer kills server with given pid, it acts like shell command "kill -15", it will also remove pid file if pid file path is specified as opts.
SortAddrs sorts the addr list with quick sort algorithm.
SyscallMode returns file mode which could be used at syscall.
TailN try to get the latest n line of the file.
# Constants
1MB.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author