Documentation ¶
Index ¶
- Constants
- Variables
- func NewManpageService() manpageService
- func NewSService(options *Option) *sservice
- type ConfigService
- type ManpageService
- type Option
- func (o *Option) WithConfig(config []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) 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 SservicePermissions
Constants ¶
View Source
const ManPath = "/usr/share/man/man1/"
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 ¶
func NewManpageService ¶
func NewManpageService() manpageService
Types ¶
type ConfigService ¶
type ConfigService interface { WriteConfigAs(filename string) error GetString(key string) string SetConfigType(in string) ReadConfig(in io.Reader) error }
ConfigService ...
type ManpageService ¶
type Option ¶
type Option struct { ExecPath string ConfigPath string User string Group string UsageExamples string UsageDetails string StartUpConfig string Config []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) 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(serviceName, description string, dependencies ...string) (d daemon.Daemon, err error) IsAdmin() (bool, error) InstallSetup(serviceName string, cmd *cobra.Command) (err error) UninstallSetup(serviceName string) (err error) EraseData(serviceName string) (err error) IsRunning(status string) bool GetDefaultConfigPath(serviceName string) (string, error) ReadConfig(serviceName string) (err error) InstallConfig(serviceName string) (err error) CopyExecInOsDefault(execPath string) (newExecPath string, err error) GetDefaultExecPath(serviceName string) (string, error) UninstallExecutables(serviceName string) error }
Sservice ...
Click to show internal directories.
Click to hide internal directories.