util

package
v0.2.0-rc4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2015 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogDirPathSuffix = "/var/log/rexray"
	EtcDirPathSuffix = "/etc/rexray"
	BinDirPathSuffix = "/usr/bin"
	RunDirPathSuffix = "/var/run/rexray"
	LibDirPathSuffix = "/var/lib/rexray"
	UnitFilePath     = "/etc/systemd/system/rexray.service"
	InitFilePath     = "/etc/init.d/rexray"
	EnvFileName      = "rexray.env"
)
View Source
const (
	LETTER_BYTES      = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
	LETTER_INDEX_BITS = 6
	LETTER_INDEX_MASK = 1<<LETTER_INDEX_BITS - 1
	LETTER_INDEX_MAX  = 63 / LETTER_INDEX_BITS
)
View Source
const ADDR_PATT = "(?i)^((?:(?:tcp|udp|ip)[46]?)|(?:unix(?:gram|packet)?))://(.+)$"

Variables

This section is empty.

Functions

func BinDirPath

func BinDirPath() string

func BinFilePath

func BinFilePath() string

func EtcDirPath

func EtcDirPath() string

func EtcFilePath

func EtcFilePath(fileName string) string

func FileExists

func FileExists(filePath string) bool

func FileExistsInPath

func FileExistsInPath(fileName string) bool

func GetLocalIP

func GetLocalIP() string

GetLocalIP returns the non loopback local IP of the host

func GetPathParts

func GetPathParts(path string) (dirPath, fileName, absPath string)

func GetPrefix

func GetPrefix() string

func GetThisPathParts

func GetThisPathParts() (dirPath, fileName, absPath string)

func HomeDir

func HomeDir() string

func Install

func Install(args ...string)

func InstallChownRoot

func InstallChownRoot(args ...string)

func InstallDirChownRoot

func InstallDirChownRoot(dirPath string)

func IsDirEmpty

func IsDirEmpty(name string) (bool, error)

func IsPrefixed

func IsPrefixed() bool

func LibDirPath

func LibDirPath() string

func LineReader

func LineReader(filePath string) <-chan string

func LogDirPath

func LogDirPath() string

func LogFile

func LogFile(fileName string) (io.Writer, error)

func LogFilePath

func LogFilePath(fileName string) string

func ParseAddress

func ParseAddress(addr string) (proto string, path string, err error)

func PidFilePath

func PidFilePath() string

func Prefix

func Prefix(p string)

func RandomString

func RandomString(length int) string

func ReadFileToString

func ReadFileToString(path string) (string, error)

func ReadPidFile

func ReadPidFile() (int, error)

func RunDirPath

func RunDirPath() string

func StdOutAndLogFile

func StdOutAndLogFile(fileName string) (io.Writer, error)

func StringInSlice

func StringInSlice(a string, list []string) bool

func WritePidFile

func WritePidFile(pid int) error

func WriteStringToFile

func WriteStringToFile(text, path string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL