Documentation ¶
Index ¶
- Constants
- func BinDirPath() string
- func BinFilePath() string
- func EtcDirPath() string
- func EtcFilePath(fileName string) string
- func FileExists(filePath string) bool
- func FileExistsInPath(fileName string) bool
- func GetLocalIP() (ip string)
- func GetPathParts(path string) (dirPath, fileName, absPath string)
- func GetPrefix() string
- func GetThisPathParts() (dirPath, fileName, absPath string)
- func HomeDir() string
- func Install(args ...string)
- func InstallChownRoot(args ...string)
- func InstallDirChownRoot(dirPath string)
- func IsDirEmpty(name string) (bool, error)
- func IsPrefixed() bool
- func LibDirPath() string
- func LibFilePath(fileName string) string
- func LineReader(filePath string) <-chan string
- func LogDirPath() string
- func LogFile(fileName string) (io.Writer, error)
- func LogFilePath(fileName string) string
- func ParseAddress(addr string) (proto string, path string, err error)
- func PidFilePath() string
- func Prefix(p string)
- func PrintVersion(out io.Writer)
- func RandomString(length int) string
- func ReadFileToString(path string) (string, error)
- func ReadPidFile() (int, error)
- func RunDirPath() string
- func StdOutAndLogFile(fileName string) (io.Writer, error)
- func StringInSlice(a string, list []string) bool
- func Trim(text string) string
- func WritePidFile(pid int) error
- func WriteStringToFile(text, path string) error
Constants ¶
const ( // UnitFilePath is the path to the SystemD service's unit file. UnitFilePath = "/etc/systemd/system/rexray.service" // InitFilePath is the path to the SystemV Service's init script. InitFilePath = "/etc/init.d/rexray" // EnvFileName is the name of the environment file used by the SystemD // service. EnvFileName = "rexray.env" )
Variables ¶
This section is empty.
Functions ¶
func BinDirPath ¶
func BinDirPath() string
BinDirPath returns the path to the REX-Ray bin directory.
func BinFilePath ¶
func BinFilePath() string
BinFilePath returns the path to the REX-Ray executable.
func EtcDirPath ¶
func EtcDirPath() string
EtcDirPath returns the path to the REX-Ray etc directory.
func EtcFilePath ¶
EtcFilePath returns the path to a file inside the REX-Ray etc directory with the provided file name.
func FileExists ¶
FileExists returns a flag indicating whether a provided file path exists.
func FileExistsInPath ¶
FileExistsInPath returns a flag indicating whether the provided file exists in the current path.
func GetLocalIP ¶
func GetLocalIP() (ip string)
GetLocalIP returns the non loopback local IP of the host
func GetPathParts ¶
GetPathParts returns the absolute directory path, the file name, and the absolute path of the provided path string.
func GetThisPathParts ¶
func GetThisPathParts() (dirPath, fileName, absPath string)
GetThisPathParts returns the same information as GetPathParts for the current executable.
func HomeDir ¶
func HomeDir() string
HomeDir returns the home directory of the user that owns the current process.
func InstallChownRoot ¶
func InstallChownRoot(args ...string)
InstallChownRoot executes the system install command and chowns the target to the root user and group.
func InstallDirChownRoot ¶
func InstallDirChownRoot(dirPath string)
InstallDirChownRoot executes the system install command with a -d flag and chowns the target to the root user and group.
func IsDirEmpty ¶
IsDirEmpty returns a flag indicating whether or not a directory has any child objects such as files or directories in it.
func IsPrefixed ¶
func IsPrefixed() bool
IsPrefixed returns a flag indicating whether or not a prefix value is set.
func LibDirPath ¶
func LibDirPath() string
LibDirPath returns the path to the REX-Ray bin directory.
func LibFilePath ¶
LibFilePath returns the path to a file inside the REX-Ray lib directory with the provided file name.
func LineReader ¶
LineReader returns a channel that reads the contents of a file line-by-line.
func LogDirPath ¶
func LogDirPath() string
LogDirPath returns the path to the REX-Ray log directory.
func LogFile ¶
LogFile returns a writer to a file inside the REX-Ray log directory with the provided file name.
func LogFilePath ¶
LogFilePath returns the path to a file inside the REX-Ray log directory with the provided file name.
func ParseAddress ¶
ParseAddress parses a standard golang network address and returns the protocol and path.
func PrintVersion ¶
PrintVersion prints the current version information to the provided writer.
func RandomString ¶
RandomString generates a random set of characters with the given lenght.
func ReadFileToString ¶
ReadFileToString reads the file at the provided path to a string.
func ReadPidFile ¶
ReadPidFile reads the REX-Ray PID from the PID file.
func RunDirPath ¶
func RunDirPath() string
RunDirPath returns the path to the REX-Ray run directory.
func StdOutAndLogFile ¶
StdOutAndLogFile returns a mutltiplexed writer for the current process's stdout descriptor and a REX-Ray log file with the provided name.
func StringInSlice ¶
StringInSlice returns a flag indicating whether or not a provided string exists in a string slice.
func Trim ¶
Trim removes all leading and trailing whitespace, including tab, newline, and carriage return characters.
func WritePidFile ¶
WritePidFile writes the current process ID to the REX-Ray PID file.
func WriteStringToFile ¶
WriteStringToFile writes the string to the file at the provided path.
Types ¶
This section is empty.