Documentation ¶
Index ¶
- Variables
- func ActivateLibStorage(ctx apitypes.Context, config gofig.Config) (apitypes.Context, gofig.Config, <-chan error, error)
- func AddKnownHost(ctx apitypes.Context, knownHostPath, host, algo string, fingerprint []byte) error
- func AssertTrustedHost(ctx apitypes.Context, host, algo string, fingerprint []byte) bool
- func CreateSelfCert(ctx apitypes.Context, certPath, keyPath, host string) error
- func EnvFilePath() string
- func EtcDirPath() string
- func EtcFilePath(fileName string) string
- func GetPrefix() string
- func Install(args ...string)
- func InstallChownRoot(args ...string)
- func InstallDirChownRoot(dirPath string)
- func IsAddressActive(proto, addr string) bool
- func IsLocalServerActive(ctx apitypes.Context, config gofig.Config) (host string, running bool)
- func IsPrefixed() bool
- func LibDirPath() string
- func LibFilePath(fileName string) string
- func LogDirPath() string
- func LogFile(fileName string) (io.Writer, error)
- func LogFilePath(fileName string) string
- func NewClient(ctx apitypes.Context, config gofig.Config) (apitypes.Client, error)
- func NewConfig(ctx apitypes.Context) (config gofig.Config)
- func PidFilePath() string
- func Prefix(p string)
- func PrintVersion(out io.Writer)
- func ReadPidFile() (int, error)
- func ReadSpecFile() (string, error)
- func RunDirPath() string
- func RunFilePath(fileName string) string
- func ScriptDirPath() string
- func ScriptFilePath(fileName string) string
- func SpecFilePath() string
- func StdOutAndLogFile(fileName string) (io.Writer, error)
- func ValidateConfig(path string)
- func WaitUntilLibStorageStopped(ctx apitypes.Context, errs <-chan error)
- func WritePidFile(pid int) error
- func WriteSpecFile(host string) error
Constants ¶
This section is empty.
Variables ¶
var ( // BinFileName is the name of the executing binary. BinFileName string // BinFilePath is the full path of the executing binary. BinFilePath string // BinFileDirPath is the full path of the executing binary's parent // directory. BinFileDirPath string // UnitFileName is the name of the SystemD service's unit file. UnitFileName string // UnitFilePath is the path to the SystemD service's unit file. UnitFilePath string // InitFileName is the name of the SystemV service's unit file. InitFileName string // InitFilePath is the path to the SystemV service's init script. InitFilePath string // PIDFileName is the name of the PID file. PIDFileName string // DotDirName is the name of the hidden app directory. DotDirName string )
var ErrHostDetectionFailed = errors.New("host detection failed")
ErrHostDetectionFailed is returned when ActivateLibStorage is invoked and the there is no host specified in the configuration file and no existing host was detected locally.
var ErrMissingService = goof.New("client must specify service")
ErrMissingService occurs when the client configuration is missing the property "libstorage.service" either at the root or as part of a module definition.
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 libStorage and returns a possibly mutated context.
func AddKnownHost ¶ added in v0.9.0
func AddKnownHost( ctx apitypes.Context, knownHostPath, host, algo string, fingerprint []byte) error
AddKnownHost adds unknown host to know_hosts file
func AssertTrustedHost ¶ added in v0.9.0
AssertTrustedHost presents the user with a onscreen prompt to accept orreject a host as a trusted, known host.
func CreateSelfCert ¶ added in v0.9.0
CreateSelfCert creates a self-signed certificate and a private key pair.
func EnvFilePath ¶ added in v0.6.4
func EnvFilePath() string
EnvFilePath returns the path to the REX-Ray env file.
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 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 IsAddressActive ¶ added in v0.6.2
IsAddressActive returns a flag indicating whether or not a an address is responding to connection attempts. This does not validate whether the address is using TLS or such a connection is possible.
func IsLocalServerActive ¶ added in v0.4.0
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 ¶
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 ¶
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 PrintVersion ¶
PrintVersion prints the current version information to the provided writer.
func ReadPidFile ¶
ReadPidFile reads the REX-Ray PID from the PID file.
func ReadSpecFile ¶ added in v0.6.2
ReadSpecFile reads the REX-Ray host address from the spec file.
func RunDirPath ¶
func RunDirPath() string
RunDirPath returns the path to the REX-Ray run directory.
func RunFilePath ¶ added in v0.4.0
RunFilePath returns the path to a file inside the REX-Ray run directory with the provided file name.
func ScriptDirPath ¶ added in v0.6.4
func ScriptDirPath() string
ScriptDirPath returns the path to the REX-Ray script directory.
func ScriptFilePath ¶ added in v0.6.4
ScriptFilePath returns the path to a file inside the REX-Ray script directory with the provided file name.
func SpecFilePath ¶ added in v0.6.2
func SpecFilePath() string
SpecFilePath returns the path to the REX-Ray spec file.
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 ValidateConfig ¶ added in v0.6.4
func ValidateConfig(path string)
ValidateConfig validates a provided configuration file.
func WaitUntilLibStorageStopped ¶ added in v0.4.0
WaitUntilLibStorageStopped blocks until libStorage is stopped.
func WritePidFile ¶
WritePidFile writes the current process ID to the REX-Ray PID file.
func WriteSpecFile ¶ added in v0.6.2
WriteSpecFile writes the current host address to the REX-Ray spec file.
Types ¶
This section is empty.