Files
yms-daemon/internal/systemd/manager.go
T

25 lines
594 B
Go
Raw Normal View History

2026-08-16 01:27:30 +08:00
// Package systemd defines the exact systemd boundary used by native executors.
package systemd
import (
"context"
"errors"
)
var ErrUnitNotFound = errors.New("systemd unit not found")
// Unit is the systemd state required for idempotent start and stop inspection.
type Unit struct {
Name string
LoadState string
ActiveState string
SubState string
}
// Manager performs direct systemd operations without invoking a shell.
type Manager interface {
Inspect(context.Context, string) (Unit, error)
Start(context.Context, string) error
Stop(context.Context, string) error
}