Documentation ¶
Index ¶
- func Install(plist Plist, log logger.Logger) error
- func LogDir() string
- func PlistDestination(label string) string
- func Restart(label string, log logger.Logger) error
- func ShowStatus(label string, log logger.Logger) error
- func Start(label string, log logger.Logger) error
- func Stop(label string, wait bool, log logger.Logger) error
- func Uninstall(label string, wait bool, log logger.Logger) error
- type EnvVar
- type Plist
- type Service
- func (s Service) CheckPlist(plist Plist) (bool, error)
- func (s Service) HasPlist() bool
- func (s Service) Install(p Plist) error
- func (s Service) Label() string
- func (s Service) LoadStatus() (*ServiceStatus, error)
- func (s Service) PlistDestination() string
- func (s Service) Restart() error
- func (s *Service) SetLogger(log logger.Logger)
- func (s Service) Start() error
- func (s Service) StatusDescription() string
- func (s Service) Stop(wait bool) error
- func (s Service) Uninstall(wait bool) (err error)
- func (s Service) WaitForExit(wait time.Duration) error
- type ServiceStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PlistDestination ¶
func ShowStatus ¶
ShowStatus shows status info for a service
Types ¶
type EnvVar ¶
type EnvVar struct {
// contains filtered or unexported fields
}
EnvVar defines and environment variable for the Plist
type Plist ¶
type Plist struct {
// contains filtered or unexported fields
}
Plist defines a launchd plist
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service defines a service
func ListServices ¶
ListServices will return service with label that starts with a filter string.
func (Service) CheckPlist ¶
CheckPlist returns false, if the plist destination doesn't match what we would install. This means the plist is old and we need to update it.
func (Service) LoadStatus ¶
func (s Service) LoadStatus() (*ServiceStatus, error)
Status returns service status
func (Service) PlistDestination ¶
func (Service) StatusDescription ¶
StatusDescription returns the service status description
type ServiceStatus ¶
type ServiceStatus struct {
// contains filtered or unexported fields
}
ServiceStatus defines status for a service
func (ServiceStatus) Description ¶
func (s ServiceStatus) Description() string
Description returns service status info
func (ServiceStatus) IsRunning ¶
func (s ServiceStatus) IsRunning() bool
IsRunning is true if the service is running (with a pid)
func (ServiceStatus) LastExitStatus ¶
func (s ServiceStatus) LastExitStatus() string
LastExitStatus will be blank if pid > 0, or a number "123"
func (ServiceStatus) Pid ¶
func (s ServiceStatus) Pid() string
Pid for status (empty string if not running)