Documentation ¶
Overview ¶
Package manager can be used cross-platform to add apps as either userspace or system services for fairly simple applications. This is not intended for complex or highly platform-specific service installers.
I'm prototyping this out to be useful for more than just watchdog hence there are a few unnecessary things for the sake of the trying it out
Index ¶
- func Install(c *service.Service) (string, error)
- func IsPrivileged() bool
- func List(conf *service.Service) ([]string, []string, []error)
- func Render(c *service.Service) ([]byte, error)
- func Run(bin string, args ...string) error
- func Start(conf *service.Service) error
- func Stop(conf *service.Service) error
- func WhereIs(exe string) (string, error)
- type ErrDaemonize
- type File
- type FileSystem
- type ManageError
- type Runnable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Install ¶
Install will do a best-effort attempt to install a start-on-startup user or system service via systemd, launchd, or reg.exe
func IsPrivileged ¶
func IsPrivileged() bool
IsPrivileged returns true if we suspect that the current user (or process) will be able to write to system folders, bind to privileged ports, and otherwise successfully run a system service.
Types ¶
type ErrDaemonize ¶
type ErrDaemonize struct { DaemonArgs []string // contains filtered or unexported fields }
func (*ErrDaemonize) Error ¶
func (e *ErrDaemonize) Error() string
type File ¶
type File interface { io.Closer io.Reader io.Seeker Readdir(count int) ([]os.FileInfo, error) Stat() (os.FileInfo, error) }
File is the same as http.File
type FileSystem ¶
FileSystem is the same as http.FileSystem
type ManageError ¶
func (*ManageError) Error ¶
func (e *ManageError) Error() string
type Runnable ¶
Runnable defines a command to run, along with its arguments, and whether or not failing to exit successfully matters. It also defines whether certains words must exist (or not exist) in its output, apart from existing successfully, to determine whether or not it was actually successful.