Documentation
¶
Index ¶
- Variables
- func NewSService(options *Option) *sservice
- type ConfigService
- type Option
- func (o *Option) WithConfig(config map[string][]byte) *Option
- func (o *Option) WithConfigPath(path string) *Option
- func (o *Option) WithExecPath(path string) *Option
- func (o *Option) WithGroup(group string) *Option
- func (o *Option) WithManPath(path string) *Option
- func (o *Option) WithStartUpConfig(config string) *Option
- func (o *Option) WithUsageDetails(usage string) *Option
- func (o *Option) WithUsageExamples(usage string) *Option
- func (o *Option) WithUser(user string) *Option
- type Sservice
- type SserviceManPages
- type SservicePermissions
- type SserviceTOREFACTOR
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") )
Functions ¶
Types ¶
type ConfigService ¶
type ConfigService interface {
WriteConfigAs(filename string) error
GetString(key string) string
SetConfigType(in string)
ReadConfig(in io.Reader) error
}
ConfigService ...
type Option ¶
type Option struct {
ExecPath string
ConfigPath string
ManPath string
User string
Group string
UsageExamples string
UsageDetails string
StartUpConfig string
Config map[string][]byte
}
Option service instance options
func (*Option) WithConfig ¶
WithConfig sets the startup configurations
func (*Option) WithConfigPath ¶
WithConfigPath sets the config path
func (*Option) WithExecPath ¶
WithExecPath sets the exec path
func (*Option) WithManPath ¶
WithManPath sets the man path
func (*Option) WithStartUpConfig ¶
WithStartUpConfig sets the startup configurations
func (*Option) WithUsageDetails ¶
WithUsageDetails sets usage details
func (*Option) WithUsageExamples ¶
WithUsageExamples sets usage examples
type Sservice ¶
type Sservice interface {
NewDaemon(name, description, execStartPath string, dependencies ...string) (d daemon.Daemon, err error)
IsAdmin() (bool, error)
InstallSetup(serviceName string) (err error)
UninstallSetup(serviceName string) (err error)
InstallConfig(serviceName string) (err error)
RemoveProgramFiles(serviceName string) (err error)
EraseData(serviceName string) (err error)
GetExecutable(input string, serviceName string) (exec string, err error)
CopyExecInOsDefault(execPath string) (newExecPath string, err error)
GetDefaultExecPath(localFile string) (string, error)
GetDefaultConfigPath(serviceName string) (string, error)
IsRunning(status string) bool
ReadConfig(serviceName string) (err error)
}
Sservice ...
type SserviceManPages ¶
type SserviceManPages interface {
// contains filtered or unexported methods
}
SserviceManPages ...
type SservicePermissions ¶
type SservicePermissions interface {
GroupCreateIfNotExists() (err error)
UserCreateIfNotExists() (err error)
SetOwnership(path string) (err error)
}
SservicePermissions ...
type SserviceTOREFACTOR ¶
type SserviceTOREFACTOR interface {
// contains filtered or unexported methods
}
SserviceTOREFACTOR ...
Click to show internal directories.
Click to hide internal directories.