Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnsupportedSystem = errors.New(1900, "unsupported system") ErrNeedSystemd = errors.New(1901, "need systemd to install the service") ErrRootPrivileges = errors.New(1902, "requires root user privileges. Possibly use 'sudo'") ErrAlreadyInstalled = errors.Newf(1903, "%s service has already been installed") ErrCurrentlyRunning = errors.Newf(1904, "%s service is running and cannot be removed") ErrNotInstalled = errors.Newf(1905, "%s service is not installed") ErrAlreadyRunning = errors.Newf(1906, "%s service is already running") ErrAlreadyStopped = errors.Newf(1907, "%s service is already stopped") )
Errors that are hit while managing an Agent's service
Functions ¶
Types ¶
type Daemon ¶
type Daemon interface { // GetTemplate - gets service config template GetTemplate() string // SetTemplate - sets service config template SetTemplate(string) error // Install the service into the system Install(args ...string) (string, error) // Update the service definition on the system Update(args ...string) (string, error) // Remove the service and all corresponding files from the system Remove() (string, error) // Start the service Start() (string, error) // Stop the service Stop() (string, error) // Status - check the service status Status() (string, error) // Enable - sets the service to persist reboots Enable() (string, error) // Logs - gets the service logs Logs() (string, error) // Run - run executable service Run(e Executable) (string, error) // SetEnvFile - sets the environment file argument for generating the agent command SetEnvFile(string) error // SetUser - sets the user that executes the service SetUser(string) error // setGroup - sets the group that executes the service SetGroup(string) error // GetServiceName - gets the name of the service GetServiceName() string }
Daemon interface has a standard set of methods/commands
type Executable ¶
type Executable interface { // Start - non-blocking start service Start() // Stop - non-blocking stop service Stop() // Run - blocking run service Run() }
Executable interface defines controlling methods of executable service
Click to show internal directories.
Click to hide internal directories.