Documentation
¶
Index ¶
- Variables
- func AddPlugin(plugin Plugin) error
- func AddProfile(profile Profile) error
- func AddTask(title, description string, tags []string) error
- func CompleteTask(id string) error
- func EnablePlugin(name string, enabled bool) error
- func ExecutePlugins(trigger string, sessionData map[string]string) error
- func ExportToCSV(filepath string) error
- func ExportToJSON(filepath string) error
- func GenerateCalendarView(months int) (string, error)
- func GetConfigDir() (string, error)
- func GetGoalFilePath() (string, error)
- func GetPluginPath() (string, error)
- func GetProfilePath() (string, error)
- func GetTaskFilePath() (string, error)
- func GetThemeFilePath() (string, error)
- func GetTodayStats() (int, int, error)
- func ImportFromJSON(filepath string) error
- func ListTasks(showCompleted bool) error
- func ListThemes()
- func SaveConfig(config Config) error
- func SaveGoal(goal Goal) error
- func SavePlugins(plugins PluginConfig) error
- func SaveProfiles(profiles ProfileConfig) error
- func SaveProgress(progress GoalProgress) error
- func SaveTasks(tasks TaskList) error
- func SaveTheme(theme Theme) error
- func ShowProgress() error
- func SyncData(upload bool) error
- func UpdateProgress(sessions, minutes int) error
- func UpdateTaskProgress(id string, sessions, minutes int) error
- type CalendarDay
- type Config
- type DropboxSync
- type ExportData
- type GitHubSync
- type Goal
- type GoalProgress
- type Plugin
- type PluginConfig
- type Profile
- type ProfileConfig
- type SessionData
- type SessionStats
- type Suggestion
- type SyncProvider
- type Task
- type TaskList
- type Theme
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultTheme is the default color scheme DefaultTheme = Theme{ Name: "default", TimerColor: "\033[1;32m", ProgressColor: "\033[1;34m", SuccessColor: "\033[1;32m", WarningColor: "\033[1;33m", TextColor: "\033[0m", HighlightColor: "\033[1;36m", } // MinimalTheme is a minimal color scheme MinimalTheme = Theme{ Name: "minimal", TimerColor: "\033[0m", ProgressColor: "\033[0m", SuccessColor: "\033[0m", WarningColor: "\033[0m", TextColor: "\033[0m", HighlightColor: "\033[1m", } // VibrantTheme is a colorful theme VibrantTheme = Theme{ Name: "vibrant", TimerColor: "\033[1;35m", ProgressColor: "\033[1;36m", SuccessColor: "\033[1;32m", WarningColor: "\033[1;31m", TextColor: "\033[1;37m", HighlightColor: "\033[1;33m", } // Available themes AvailableThemes = map[string]Theme{ "default": DefaultTheme, "minimal": MinimalTheme, "vibrant": VibrantTheme, } )
var DefaultConfig = Config{ WorkMinutes: 25, BreakMinutes: 5, NumSessions: 4, CurrentProfile: "default", PrivacyMode: false, CloudSync: false, CloudProvider: "", }
var DefaultProfiles = []Profile{
{Name: "default", WorkMinutes: 25, BreakMinutes: 5, NumSessions: 4, Description: "Standard Pomodoro"},
{Name: "work", WorkMinutes: 45, BreakMinutes: 10, NumSessions: 3, Description: "Deep work sessions"},
{Name: "study", WorkMinutes: 30, BreakMinutes: 5, NumSessions: 4, Description: "Study sessions"},
{Name: "quick", WorkMinutes: 15, BreakMinutes: 3, NumSessions: 6, Description: "Quick tasks"},
}
Functions ¶
func AddProfile ¶
func EnablePlugin ¶
func ExportToCSV ¶
func ExportToJSON ¶
func GenerateCalendarView ¶
func GetConfigDir ¶
GetConfigDir returns the path to the configuration directory
func GetGoalFilePath ¶
GetGoalFilePath returns the path to the goals configuration file
func GetPluginPath ¶
func GetTaskFilePath ¶
GetTaskFilePath returns the path to the tasks file
func GetThemeFilePath ¶
GetThemeFilePath returns the path to the theme configuration file
func GetTodayStats ¶
func ImportFromJSON ¶
func SaveConfig ¶
SaveConfig saves the configuration to the config file
func SavePlugins ¶
func SavePlugins(plugins PluginConfig) error
func SaveProfiles ¶
func SaveProfiles(profiles ProfileConfig) error
func SaveProgress ¶
func SaveProgress(progress GoalProgress) error
SaveProgress saves the current progress to the configuration file
func ShowProgress ¶
func ShowProgress() error
ShowProgress displays the current progress towards goals
func UpdateProgress ¶
UpdateProgress updates the goal progress for today
func UpdateTaskProgress ¶
UpdateTaskProgress updates the time spent on a task
Types ¶
type CalendarDay ¶
type Config ¶
type Config struct {
WorkMinutes int `json:"work_minutes"`
BreakMinutes int `json:"break_minutes"`
NumSessions int `json:"num_sessions"`
CurrentProfile string `json:"current_profile"`
PrivacyMode bool `json:"privacy_mode"`
CloudSync bool `json:"cloud_sync"`
CloudProvider string `json:"cloud_provider"`
}
func LoadConfig ¶
LoadConfig loads the configuration from the config file
type DropboxSync ¶
type DropboxSync struct {
AccessToken string
}
func (*DropboxSync) Download ¶
func (d *DropboxSync) Download(remotePath, localPath string) error
func (*DropboxSync) IsAvailable ¶
func (d *DropboxSync) IsAvailable() bool
func (*DropboxSync) Upload ¶
func (d *DropboxSync) Upload(localPath, remotePath string) error
type ExportData ¶
type ExportData struct {
Sessions []SessionData `json:"sessions"`
Tasks []Task `json:"tasks"`
Goal Goal `json:"goal"`
Progress GoalProgress `json:"progress"`
Config Config `json:"config"`
Profiles []Profile `json:"profiles"`
}
type GitHubSync ¶
func (*GitHubSync) Download ¶
func (g *GitHubSync) Download(remotePath, localPath string) error
func (*GitHubSync) IsAvailable ¶
func (g *GitHubSync) IsAvailable() bool
func (*GitHubSync) Upload ¶
func (g *GitHubSync) Upload(localPath, remotePath string) error
type Goal ¶
type Goal struct {
DailySessionTarget int `json:"daily_session_target"` // Target number of sessions per day
DailyMinutes int `json:"daily_minutes"` // Target minutes of focus time per day
StartDate time.Time `json:"start_date"` // When this goal was set
EndDate time.Time `json:"end_date,omitempty"` // Optional end date for the goal
}
Goal represents a daily Pomodoro goal
type GoalProgress ¶
type GoalProgress struct {
CurrentDate time.Time `json:"current_date"`
SessionsToday int `json:"sessions_today"`
MinutesToday int `json:"minutes_today"`
CurrentStreak int `json:"current_streak"` // Days in a row meeting goals
LongestStreak int `json:"longest_streak"` // Longest streak ever
LastUpdateDate time.Time `json:"last_update_date"` // Last time progress was updated
}
GoalProgress tracks progress towards goals
func LoadProgress ¶
func LoadProgress() (GoalProgress, error)
LoadProgress loads the progress from the configuration file
type PluginConfig ¶
type PluginConfig struct {
Plugins []Plugin `json:"plugins"`
}
func LoadPlugins ¶
func LoadPlugins() (PluginConfig, error)
type Profile ¶
type Profile struct {
Name string `json:"name"`
WorkMinutes int `json:"work_minutes"`
BreakMinutes int `json:"break_minutes"`
NumSessions int `json:"num_sessions"`
Description string `json:"description"`
}
func GetProfile ¶
type ProfileConfig ¶
type ProfileConfig struct {
Profiles []Profile `json:"profiles"`
}
func LoadProfiles ¶
func LoadProfiles() (ProfileConfig, error)
type SessionData ¶
type SessionStats ¶
type SessionStats struct {
AverageWorkTime float64
AverageBreakTime float64
CompletionRate float64
PreferredTimeSlots []int // Hours of day
ProductivityScore float64
}
func AnalyzePerformance ¶
func AnalyzePerformance() (SessionStats, error)
type Suggestion ¶
type Suggestion struct {
Type string `json:"type"`
Message string `json:"message"`
WorkTime int `json:"work_time,omitempty"`
BreakTime int `json:"break_time,omitempty"`
Sessions int `json:"sessions,omitempty"`
Confidence float64 `json:"confidence"`
}
func GenerateSuggestions ¶
func GenerateSuggestions() ([]Suggestion, error)
type SyncProvider ¶
type SyncProvider interface {
Upload(localPath, remotePath string) error
Download(remotePath, localPath string) error
IsAvailable() bool
}
func GetSyncProvider ¶
func GetSyncProvider(config Config) SyncProvider
type Task ¶
type Task struct {
ID string `json:"id"` // Unique identifier
Title string `json:"title"` // Task title
Description string `json:"description"` // Optional description
CreatedAt time.Time `json:"created_at"` // When the task was created
CompletedAt time.Time `json:"completed_at"` // When the task was completed
Sessions int `json:"sessions"` // Number of sessions spent on this task
Minutes int `json:"minutes"` // Total minutes spent on this task
Tags []string `json:"tags"` // Optional tags for categorization
IsCompleted bool `json:"is_completed"` // Whether the task is completed
}
Task represents a task to be completed during Pomodoro sessions
type TaskList ¶
type TaskList struct {
Tasks []Task `json:"tasks"`
}
TaskList represents a list of tasks
type Theme ¶
type Theme struct {
Name string `json:"name"`
TimerColor string `json:"timer_color"` // Color for timer display
ProgressColor string `json:"progress_color"` // Color for progress bar
SuccessColor string `json:"success_color"` // Color for success messages
WarningColor string `json:"warning_color"` // Color for warning messages
TextColor string `json:"text_color"` // Color for regular text
HighlightColor string `json:"highlight_color"` // Color for highlighted text
BackgroundColor string `json:"background_color"` // Color for background (if supported)
}
Theme represents a color scheme for the application