config

package
v0.9.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2025 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists

func Exists() (bool, error)

Exists checks if the configuration file exists

func GetConfigPath

func GetConfigPath() (string, error)

GetConfigPath returns the path to the configuration file

func SaveConfig

func SaveConfig(cfg *Config) error

SaveConfig saves the configuration to file

Types

type CalendarIntegration

type CalendarIntegration struct {
	Provider      string `yaml:"provider" mapstructure:"provider"`
	BlockCalendar bool   `yaml:"block_calendar" mapstructure:"block_calendar"`
}

CalendarIntegration contains calendar-related settings

type Command

type Command struct {
	Name       string `yaml:"name" mapstructure:"name"`
	Command    string `yaml:"command" mapstructure:"command"`
	Optional   bool   `yaml:"optional" mapstructure:"optional"`
	Background bool   `yaml:"background" mapstructure:"background"`
}

Command represents a ritual command

type Config

type Config struct {
	Version      int          `yaml:"version" mapstructure:"version"`
	UserID       string       `yaml:"user_id" mapstructure:"user_id"`
	Settings     Settings     `yaml:"settings" mapstructure:"settings"`
	Projects     []Project    `yaml:"projects" mapstructure:"projects"`
	Rituals      Rituals      `yaml:"rituals" mapstructure:"rituals"`
	Integrations Integrations `yaml:"integrations" mapstructure:"integrations"`
}

Config represents the main configuration structure

func Load

func Load() (*Config, error)

Load loads the configuration from the default location or specified file

func LoadConfig

func LoadConfig() (*Config, error)

LoadConfig loads the configuration from file

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration

type GitIntegration

type GitIntegration struct {
	Enabled           bool `yaml:"enabled" mapstructure:"enabled"`
	AutoDetectProject bool `yaml:"auto_detect_project" mapstructure:"auto_detect_project"`
}

GitIntegration contains Git-related settings

type Integrations

type Integrations struct {
	Git       GitIntegration       `yaml:"git" mapstructure:"git"`
	Slack     SlackIntegration     `yaml:"slack" mapstructure:"slack"`
	Calendar  CalendarIntegration  `yaml:"calendar" mapstructure:"calendar"`
	Telemetry TelemetryIntegration `yaml:"telemetry" mapstructure:"telemetry"`
}

Integrations contains external service integrations

type NotificationSettings

type NotificationSettings struct {
	Enabled           bool `yaml:"enabled" mapstructure:"enabled"`
	BreakReminders    bool `yaml:"break_reminders" mapstructure:"break_reminders"`
	EndOfDayReminders bool `yaml:"end_of_day_reminders" mapstructure:"end_of_day_reminders"`
	SessionComplete   bool `yaml:"session_complete" mapstructure:"session_complete"`
	IdleDetection     bool `yaml:"idle_detection" mapstructure:"idle_detection"`
	Sound             bool `yaml:"sound" mapstructure:"sound"`
}

NotificationSettings contains notification preferences

type Project

type Project struct {
	Name   string   `yaml:"name" mapstructure:"name"`
	Detect []string `yaml:"detect" mapstructure:"detect"`
}

Project represents a project configuration

type RitualSet

type RitualSet struct {
	Global     []Command            `yaml:"global" mapstructure:"global"`
	PerProject map[string][]Command `yaml:"per_project" mapstructure:"per_project"`
}

RitualSet contains global and per-project rituals

type Rituals

type Rituals struct {
	Start RitualSet `yaml:"start" mapstructure:"start"`
	Stop  RitualSet `yaml:"stop" mapstructure:"stop"`
}

Rituals contains start and stop ritual configurations

type Settings

type Settings struct {
	WorkHours     float64              `yaml:"work_hours" mapstructure:"work_hours"`
	BreakInterval time.Duration        `yaml:"break_interval" mapstructure:"break_interval"`
	IdleThreshold time.Duration        `yaml:"idle_threshold" mapstructure:"idle_threshold"`
	Notifications NotificationSettings `yaml:"notifications" mapstructure:"notifications"`
}

Settings contains global application settings

type SlackIntegration

type SlackIntegration struct {
	Workspace  string `yaml:"workspace" mapstructure:"workspace"`
	DNDOnStart bool   `yaml:"dnd_on_start" mapstructure:"dnd_on_start"`
}

SlackIntegration contains Slack-related settings

type TelemetryIntegration

type TelemetryIntegration struct {
	Enabled         bool   `yaml:"enabled" mapstructure:"enabled"`
	SegmentWriteKey string `yaml:"segment_write_key" mapstructure:"segment_write_key"`
	SentryDSN       string `yaml:"sentry_dsn" mapstructure:"sentry_dsn"`
}

TelemetryIntegration contains telemetry-related settings

Jump to

Keyboard shortcuts

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