Documentation
¶
Index ¶
- Variables
- func CheckPrivileges() (bool, error)
- func CopyExecInOsDefault(execPath string) (newExecPath string, err error)
- func EraseData(serviceName string) (err error)
- func GetDefaultConfigPath(serviceName string) string
- func GetDefaultExecPath(localFile string) string
- func GetExecutable(input string, serviceName string) (exec string, err error)
- func InstallSetup(serviceName string) (err error)
- func IsRunning(status string) bool
- func NewDaemon(name, description, execStartPath string, dependencies ...string) (d daemon.Daemon, err error)
- func RemoveProgramFiles(serviceName string) (err error)
- func UninstallSetup(serviceName string) (err error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrUnsupportedSystem appears if try to use service on system which is not supported by this release ErrUnsupportedSystem = errors.New("unsupported system") // ErrRootPrivileges appears if run installation or deleting the service without root privileges ErrRootPrivileges = errors.New("you must have root user privileges. Possibly using 'sudo' command should help") // ErrExecNotFound provided executable file does not exists ErrExecNotFound = errors.New("executable file does not exists or not provided") // ErrServiceNotInstalled provided executable file does not exists ErrServiceNotInstalled = errors.New("Service is not installed") )
var UsageDet = fmt.Sprintf(`Config file is present in %s. Log file is in /var/log/immuclient`, linuxConfigPath)
UsageDet details on config and log file on specific os
var UsageExamples = `` /* 346-byte string literal not displayed */
UsageExamples usage examples for linux
Functions ¶
func CheckPrivileges ¶
CheckPrivileges check if current user is root
func CopyExecInOsDefault ¶
todo @Michele this can be simplified -> CopyExecInOsDefault(servicename string) toto @Michele use functions from the fs package? CopyExecInOsDefault copy the executable in default exec folder and returns the path. It accepts an executable absolute path
func GetDefaultConfigPath ¶
GetDefaultConfigPath returns the default config path
func GetDefaultExecPath ¶
GetDefaultExecPath returns the default exec path. It accepts an executable or the absolute path of an executable and returns the default exec path using the exec name provided
func GetExecutable ¶
todo @Michele this can be simplified GetExecutable checks for the service executable name provided. If it's valid returns the absolute file path If is not valid or not presents try to use an executable presents in current executable folder. If found it returns the absolute file path
func InstallSetup ¶
func RemoveProgramFiles ¶
todo @Michele this should be moved in UninstallSetup RemoveProgramFiles remove all program files
func UninstallSetup ¶
@todo Michele helper unix should be refactor in order to expose an interface that every service need to implemented. UninstallSetup uninstall operations
Types ¶
This section is empty.