config

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Tasks     map[string]TaskConfig     `toml:"tasks"`
	Reminders map[string]ReminderConfig `toml:"reminders"`
}

Config represents the orbit configuration structure.

func LoadConfig

func LoadConfig(path string) (*Config, error)

LoadConfig loads and returns the configuration from the specified path.

func (*Config) Validate

func (c *Config) Validate() error

Validate checks the configuration for required fields and valid values.

type OnMissedPolicy

type OnMissedPolicy string

OnMissedPolicy defines behavior when a scheduled run is missed.

const (
	OnMissedRunOnce OnMissedPolicy = "run_once"
	OnMissedSkip    OnMissedPolicy = "skip"
)

type ReminderConfig

type ReminderConfig struct {
	Command  string `toml:"command"` // optional
	Schedule string `toml:"schedule"`
	Message  string `toml:"message"`
	Snooze   string `toml:"snooze"`
	Check    string `toml:"check"` // optional: only fire if this command exits 0
}

ReminderConfig represents a reminder configuration.

type RetryConfig

type RetryConfig struct {
	Attempts *int   `toml:"attempts"`
	Delay    string `toml:"delay"`
}

RetryConfig represents retry settings for a task.

func (RetryConfig) GetAttempts

func (r RetryConfig) GetAttempts() int

GetAttempts returns the number of retry attempts, defaulting to 0 if nil.

type TaskConfig

type TaskConfig struct {
	Command  string         `toml:"command"`
	Schedule string         `toml:"schedule"`
	OnMissed OnMissedPolicy `toml:"on_missed"`
	Retry    RetryConfig    `toml:"retry"`
}

TaskConfig represents a task configuration.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL