Documentation
¶
Index ¶
- func Register(reg *execution.ActionRegistry)
- type Disable
- type Enable
- type Provider
- func (p *Provider) CompensateDisable(state map[string]any) error
- func (p *Provider) CompensateEnable(state map[string]any) error
- func (p *Provider) CompensateRestart(_ map[string]any) error
- func (p *Provider) CompensateStart(state map[string]any) error
- func (p *Provider) CompensateStop(state map[string]any) error
- func (p *Provider) Disable(name string, output io.Writer) (map[string]any, error)
- func (p *Provider) Enable(name string, output io.Writer) (map[string]any, error)
- func (p *Provider) Restart(name string, output io.Writer) (map[string]any, error)
- func (p *Provider) Start(name string, output io.Writer) (map[string]any, error)
- func (p *Provider) Stop(name string, output io.Writer) (map[string]any, error)
- type Restart
- type Start
- type Stop
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(reg *execution.ActionRegistry)
Register registers all service actions with the given registry.
Types ¶
type Disable ¶
type Disable struct{ Impl *Provider }
Disable disables a service from starting at boot.
type Enable ¶
type Enable struct{ Impl *Provider }
Enable enables a service to start at boot.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider provides platform-agnostic service management. Platform detection happens at runtime — callers don't need to know whether launchd, systemd, or Windows services are being used.
Compensable Forward methods return (map[string]any, error). The map is the compensation receipt — opaque to the executor, meaningful only to the corresponding Compensate* Backward method.
func (*Provider) CompensateDisable ¶
CompensateDisable undoes a Disable by enabling the service if it was enabled before.
func (*Provider) CompensateEnable ¶
CompensateEnable undoes an Enable by disabling the service if it wasn't enabled before.
func (*Provider) CompensateRestart ¶
CompensateRestart is a no-op. A restarted service was already running; the service is still running after restart — nothing to undo.
func (*Provider) CompensateStart ¶
CompensateStart undoes a Start by stopping the service if it wasn't running before.
func (*Provider) CompensateStop ¶
CompensateStop undoes a Stop by starting the service if it was running before.
func (*Provider) Disable ¶
Disable disables a service from starting at boot. Returns compensation state with pre-action enabled status.
func (*Provider) Enable ¶
Enable enables a service to start at boot. Returns compensation state with pre-action enabled status.
func (*Provider) Restart ¶
Restart restarts a service. Returns compensation state. Compensation is a no-op — if the service was restarted, it was already running.
type Restart ¶
type Restart struct{ Impl *Provider }
Restart restarts a service.