Documentation
¶
Index ¶
- Constants
- Variables
- func ControlService(env *Parameters, c Cmd, to State) error
- func DecryptPassword(data, key string) (string, error)
- func DisableService(env *Parameters) error
- func EnableService(env *Parameters) error
- func InstallService(env *Parameters) error
- func IsService() bool
- func RemoveService(env *Parameters) error
- func RunService(env *Parameters, isDebug bool)
- func ShutdownService(env *Parameters) error
- func StartService(env *Parameters) error
- func StatusService(env *Parameters) error
- func StopService(env *Parameters) error
- type Cmd
- type Interface
- type Parameters
- func (env *Parameters) AdaptConfigure(name string) error
- func (env *Parameters) AppDirectory() string
- func (env *Parameters) FileName() string
- func (env *Parameters) ParseInstallXML(fileName string) error
- func (env *Parameters) PrepareService() error
- func (env *Parameters) ServiceName() string
- func (env *Parameters) StartCommand(command string, arg []string) error
- type Properties
- type State
Constants ¶
const LibEnvironment = "LD_LIBRARY_PATH"
LibEnvironment environment variable setting search for system libraries
Variables ¶
var SystemPath = "/usr/lib/systemd/system"
SystemPath system path for systemd configurations
Functions ¶
func ControlService ¶
func ControlService(env *Parameters, c Cmd, to State) error
ControlService control the service
func DecryptPassword ¶
DecryptPassword decrypt installation password
func StatusService ¶
func StatusService(env *Parameters) error
StatusService disable the status of the service
Types ¶
type Interface ¶
type Interface interface {
Run(env *Parameters) error
Shutdown(env *Parameters) error
}
Interface service interface for services
type Parameters ¶
type Parameters struct {
Name string
DisplayName string
AppPath string
Description string
Path string
WrapperName string
Environments []string
Parameters []string
ID int
User string
Password string
Group string
ServiceFct Interface
Cmd *exec.Cmd
}
Parameters installation environment settings
func InitService ¶
func InitService(name, appName, description string, svc Interface) *Parameters
InitService initialize installation environment structure
func (*Parameters) AdaptConfigure ¶
func (env *Parameters) AdaptConfigure(name string) error
AdaptConfigure load installation configuration and adapt service parameters to the installation parameters
func (*Parameters) AppDirectory ¶
func (env *Parameters) AppDirectory() string
AppDirectory provide path of installation
func (*Parameters) FileName ¶
func (env *Parameters) FileName() string
FileName used file name system file name plist
func (*Parameters) ParseInstallXML ¶
func (env *Parameters) ParseInstallXML(fileName string) error
ParseInstallXML parse install XML file
func (*Parameters) PrepareService ¶
func (env *Parameters) PrepareService() error
PrepareService generate installation configuration and write service parameters to the installation file
func (*Parameters) ServiceName ¶
func (env *Parameters) ServiceName() string
ServiceName used file name system name
func (*Parameters) StartCommand ¶
func (env *Parameters) StartCommand(command string, arg []string) error
StartCommand execute application in given environment