Documentation
¶
Overview ¶
Package svc installs and controls flockd as an OS service: launchd (macOS), systemd (Linux) and Windows SCM (stub). `tera up|down|uninstall` drive this.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrUnsupported = errors.New("svc: service management not implemented on this platform")
ErrUnsupported marks platforms whose integration is still a stub.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager interface {
// Install writes the service definition pointing at binPath with args.
Install(ctx context.Context, binPath string, args []string, opts Options) error
Uninstall(ctx context.Context) error
Start(ctx context.Context) error
Stop(ctx context.Context) error
Status(ctx context.Context) (Status, error)
}
Manager is the platform-specific service controller.
func NewManager ¶
func NewManager() Manager
NewManager returns the manager for the current OS (svc_*.go).
type Options ¶
type Options struct {
// LogPath receives the daemon's stdout+stderr where the platform has no
// native log sink (launchd). systemd ignores it — journalctl already
// captures the unit's output.
LogPath string
// Notice receives non-fatal, operator-facing notes from Install
// (e.g. Linux lingering). Warn is for things the operator should act
// on; Info for confirmations. Either may be nil.
Warn func(msg string)
Info func(msg string)
}
Options tune the installed service definition.