service

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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")
)
View Source
var UsageDet = fmt.Sprintf(`Config and log files are present in C:\ProgramData\Immudb folder`)

UsageDet details on config and log file on specific os

View Source
var UsageExamples = fmt.Sprintf(`Install the immutable database
immuadmin.exe service immudb install
Install the REST proxy client with rest interface. We discourage to install immugw in the same machine of immudb in order to respect the security model of our technology.
This kind of istallation is suggested only for testing purpose
immuadmin.exe service immugw install
It's possible to provide a specific executable
immuadmin.exe service immudb install --local-file immudb.exe
Uninstall immudb after 20 second
immuadmin.exe service immudb uninstall --time 20
`)

UsageExamples examples

Functions

func CheckPrivileges

func CheckPrivileges() (bool, error)

func CopyExecInOsDefault

func CopyExecInOsDefault(execPath string) (newExecPath string, err error)

todo @Michele use functions from the fs package? CopyExecInOsDefault copy the executable in default exec folder and returns the path

func EraseData

func EraseData(serviceName string) (err error)

EraseData erase all data

func GetDefaultConfigPath

func GetDefaultConfigPath(serviceName string) (dataDir string, err error)

GetDefaultConfigPath returns the default config path

func GetDefaultExecPath

func GetDefaultExecPath(execPath string) (string, error)

GetDefaultExecPath returns the default exec path

func GetExecutable

func GetExecutable(input string, serviceName string) (exec string, err error)

GetExecutable looks for the service executable name provided or try to use an executable presents in current folder. It returns the absolute file path

func InstallSetup

func InstallSetup(serviceName string) (err error)

func IsRunning

func IsRunning(status string) bool

IsRunning check if status derives from a running process

func NewDaemon

func NewDaemon(name, description, execStartPath string, dependencies ...string) (d daemon.Daemon, err error)

func RemoveProgramFiles

func RemoveProgramFiles(serviceName string) (err error)

RemoveProgramFiles remove all program files

func UninstallSetup

func UninstallSetup(serviceName string) (err error)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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