Documentation
¶
Index ¶
- func DeleteAllStatusesForService(service *services.ServiceConfig, baseDir string) error
- func DeleteStatusForService(service *services.ServiceConfig, instanceId, baseDir string) error
- func HasRunning(dirConfig *home.EdwardConfiguration, service *services.ServiceConfig) (bool, error)
- func InterruptGroup(cfg services.OperationConfig, pgid int, service *services.ServiceConfig) error
- func KillGroup(cfg services.OperationConfig, pgid int, service *services.ServiceConfig) error
- func Launch(dirConfig *home.EdwardConfiguration, c *services.ServiceConfig, ...) error
- func LoadRunningServices(stateDir string) ([]services.ServiceOrGroup, error)
- func LoadStatusForService(service *services.ServiceConfig, baseDir string) (map[string]Status, error)
- func SaveStatusForService(service *services.ServiceConfig, instanceId string, status Status, ...) error
- func Stop(dirConfig *home.EdwardConfiguration, c *services.ServiceConfig, ...) error
- func WaitUntilRunning(dirCfg *home.EdwardConfiguration, cmd *exec.Cmd, ...) error
- type Instance
- type State
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteAllStatusesForService ¶
func DeleteAllStatusesForService(service *services.ServiceConfig, baseDir string) error
func DeleteStatusForService ¶
func DeleteStatusForService(service *services.ServiceConfig, instanceId, baseDir string) error
func HasRunning ¶
func HasRunning(dirConfig *home.EdwardConfiguration, service *services.ServiceConfig) (bool, error)
HasRunning returns true iff the specified service has a currently running instance
func InterruptGroup ¶
func InterruptGroup(cfg services.OperationConfig, pgid int, service *services.ServiceConfig) error
InterruptGroup sends an interrupt signal to a process group. Will use sudo if required by this service.
func KillGroup ¶
func KillGroup(cfg services.OperationConfig, pgid int, service *services.ServiceConfig) error
KillGroup sends a kill signal to a process group. Will use sudo priviledges if required by this service.
func Launch ¶
func Launch(dirConfig *home.EdwardConfiguration, c *services.ServiceConfig, cfg services.OperationConfig, overrides services.ContextOverride, task tracker.Task, pool *worker.Pool) error
Launch launches this service
func LoadRunningServices ¶
func LoadRunningServices(stateDir string) ([]services.ServiceOrGroup, error)
func LoadStatusForService ¶
func SaveStatusForService ¶
func Stop ¶
func Stop(dirConfig *home.EdwardConfiguration, c *services.ServiceConfig, cfg services.OperationConfig, overrides services.ContextOverride, task tracker.Task, pool *worker.Pool) error
Stop stops this service
func WaitUntilRunning ¶
func WaitUntilRunning(dirCfg *home.EdwardConfiguration, cmd *exec.Cmd, service *services.ServiceConfig) error
WaitUntilRunning will block the specified service until it enters the running state
Types ¶
type Instance ¶
type Instance struct {
// Parent service config
Service *services.ServiceConfig `json:"service"`
// Pid of currently running instance
Pid int `json:"pid"`
// Config file from which this instance was launched
ConfigFile string `json:"configFile"`
// The edward version under which this instance was launched
EdwardVersion string `json:"edwardVersion"`
// Overrides applied by the group under which this service was started
Overrides services.ContextOverride `json:"overrides,omitempty"`
// Identifier for this instance of the service
InstanceId string
// contains filtered or unexported fields
}
Instance provides state and functions for managing a service
func Load ¶
func Load(dirConfig *home.EdwardConfiguration, service *services.ServiceConfig, overrides services.ContextOverride) (command *Instance, err error)
Load loads an instance to control the specified service
func (*Instance) Getenv ¶
Getenv returns the environment variable value for the provided key, if present. Env overrides are consulted first, followed by service env settings, then the os Env.
func (*Instance) StartAsync ¶
StartAsync starts the service in the background Will block until the service is known to have started successfully. If the service fails to launch, an error will be returned.
func (*Instance) StopSync ¶
func (c *Instance) StopSync(cfg services.OperationConfig, overrides services.ContextOverride, task tracker.Task) error
StopSync stops this service in a synchronous manner