Documentation
¶
Index ¶
- func IsOrbitUnit(name string) bool
- func ReminderServiceName(name string) string
- func ReminderTimerName(name string) string
- func SnoozeTimerName(name string) string
- func TaskServiceName(name string) string
- func TaskTimerName(name string) string
- type ChangeSet
- type Manager
- func (m *Manager) ApplyUnits(units []Unit) error
- func (m *Manager) ClassifyChanges(desired []Unit, existingNames []string) ChangeSet
- func (m *Manager) EnableAndStartTimer(timerName string)
- func (m *Manager) EnableAndStartTimers(timerNames []string)
- func (m *Manager) GenerateReminderUnits(name, schedule string) ([]Unit, error)
- func (m *Manager) GenerateSnoozeTimer(name string, until time.Time) (Unit, error)
- func (m *Manager) GenerateTaskUnits(name, schedule string, onMissed config.OnMissedPolicy) ([]Unit, error)
- func (m *Manager) ListUnits() ([]string, error)
- func (m *Manager) RemoveUnits(units []Unit) error
- func (m *Manager) StopAndDisableTimer(timerName string)
- func (m *Manager) StopAndDisableTimers(timerNames []string)
- type Systemctl
- type Unit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsOrbitUnit ¶
IsOrbitUnit returns true if the unit name is managed by orbit.
func ReminderServiceName ¶
ReminderServiceName returns the systemd service unit name for a reminder.
func ReminderTimerName ¶
ReminderTimerName returns the systemd timer unit name for a reminder.
func SnoozeTimerName ¶
SnoozeTimerName returns the systemd timer unit name for a snoozed reminder.
func TaskServiceName ¶
TaskServiceName returns the systemd service unit name for a task.
func TaskTimerName ¶
TaskTimerName returns the systemd timer unit name for a task.
Types ¶
type ChangeSet ¶
type ChangeSet struct {
Create []Unit // new units to create
Update []Unit // existing units whose content changed
Remove []Unit // units to delete
Keep []Unit // units that are already up-to-date
}
ChangeSet describes the set of changes needed to reconcile desired state.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles systemd unit operations (always user-mode).
func NewManager ¶
NewManager creates a new systemd manager for user-level units. orbitPath is the absolute path to the orbit binary, used in generated unit files.
func (*Manager) ApplyUnits ¶
ApplyUnits writes all units to disk, reloads the daemon once, then enables and starts any timer units.
func (*Manager) ClassifyChanges ¶
ClassifyChanges compares desired units against what's on disk and returns a ChangeSet. This is the foundation for a future `orbit plan` command.
func (*Manager) EnableAndStartTimer ¶
EnableAndStartTimer enables and starts a timer unit.
func (*Manager) EnableAndStartTimers ¶
EnableAndStartTimers enables and starts multiple timer units in batch.
func (*Manager) GenerateReminderUnits ¶
GenerateReminderUnits generates service and timer units for a reminder. schedule is a systemd OnCalendar expression.
func (*Manager) GenerateSnoozeTimer ¶
GenerateSnoozeTimer generates a persistent snooze timer for a reminder. The timer triggers the reminder's existing service unit at the specified time.
func (*Manager) GenerateTaskUnits ¶
func (m *Manager) GenerateTaskUnits(name, schedule string, onMissed config.OnMissedPolicy) ([]Unit, error)
GenerateTaskUnits generates units for a task. If schedule is empty, only a service unit is generated (no timer). Otherwise, both a service and timer unit are generated.
func (*Manager) ListUnits ¶
ListUnits returns the names of all orbit-managed units known to systemd.
func (*Manager) RemoveUnits ¶
RemoveUnits stops, disables, and deletes the given units, then reloads the daemon once.
func (*Manager) StopAndDisableTimer ¶
StopAndDisableTimer stops and disables a timer unit.
func (*Manager) StopAndDisableTimers ¶
StopAndDisableTimers stops and disables multiple timer units in batch.