package
1.0.7
Repository: https://github.com/rikugun/easygolib.git
Documentation: pkg.go.dev

# README

service GoDoc

service will install / un-install, start / stop, and run a program as a service (daemon). Currently supports Windows XP+, Linux/(systemd | Upstart | SysV), and OSX/Launchd.

Windows controls services by setting up callbacks that is non-trivial. This is very different then other systems. This package provides the same API despite the substantial differences. It also can be used to detect how a program is called, from an interactive terminal or from a service manager.

BUGS

  • Dependencies field is not implemented for Linux systems and Launchd.
  • OS X when running as a UserService Interactive will not be accurate.

# Functions

AvailableSystems returns the list of system services considered when choosing the system service.
ChooseSystem chooses a system from the given system services.
ChosenSystem returns the system that service will use.
Control issues control functions to the service from a given action string.
Interactive returns false if running under the OS service manager and true otherwise.
New creates a new service based on a service interface and configuration.
Platform returns a description of the system service.

# Variables

ConsoleLogger logs to the std err.
ControlAction list valid string texts to use in Control.
ErrNameFieldRequired is returned when Conifg.Name is empty.
ErrNoServiceSystemDetected is returned when no system was detected.

# Structs

Config provides the setup for a Service.

# Interfaces

Interface represents the service interface for a program.
Logger writes to the system log.
Service represents a service that can be run or controlled.
System represents the service manager that is available.

# Type aliases

KeyValue provides a list of platform specific options.