util

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2016 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
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 ActivateLibStorage added in v0.4.0

func ActivateLibStorage(
	ctx apitypes.Context,
	config gofig.Config) (apitypes.Context, gofig.Config, <-chan error, error)

ActivateLibStorage activates a libStorage server if conditions are met and returns a possibly mutated context.

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

func EtcFilePath(fileName string) string

EtcFilePath returns the path to a file inside the REX-Ray etc directory with the provided file name.

func GetPrefix

func GetPrefix() string

GetPrefix gets the root path to the REX-Ray data.

func Install

func Install(args ...string)

Install executes the system install command.

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 IsLocalServerActive added in v0.4.0

func IsLocalServerActive(
	ctx apitypes.Context, config gofig.Config) (host string, running bool)

IsLocalServerActive returns a flag indicating whether or not a local libStorage is already running.

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

func LibFilePath(fileName string) string

LibFilePath returns the path to a file inside the REX-Ray lib directory with the provided file name.

func LogDirPath

func LogDirPath() string

LogDirPath returns the path to the REX-Ray log directory.

func LogFile

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

LogFile returns a writer to a file inside the REX-Ray log directory with the provided file name.

func LogFilePath

func LogFilePath(fileName string) string

LogFilePath returns the path to a file inside the REX-Ray log directory with the provided file name.

func PidFilePath

func PidFilePath() string

PidFilePath returns the path to the REX-Ray PID file.

func Prefix

func Prefix(p string)

Prefix sets the root path to the REX-Ray data.

func PrintVersion

func PrintVersion(out io.Writer)

PrintVersion prints the current version information to the provided writer.

func ReadPidFile

func ReadPidFile() (int, error)

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 RunFilePath added in v0.4.0

func RunFilePath(fileName string) string

RunFilePath returns the path to a file inside the REX-Ray run directory with the provided file name.

func StdOutAndLogFile

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

StdOutAndLogFile returns a mutltiplexed writer for the current process's stdout descriptor and a REX-Ray log file with the provided name.

func WaitUntilLibStorageStopped added in v0.4.0

func WaitUntilLibStorageStopped(ctx apitypes.Context, errs <-chan error)

WaitUntilLibStorageStopped blocks until libStorage is stopped.

func WritePidFile

func WritePidFile(pid int) error

WritePidFile writes the current process ID to the REX-Ray PID file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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