Documentation
¶
Index ¶
- Variables
- func FlushLog(w io.Writer)
- func FormatStatus(status Status) string
- func InitDB(db *Store) error
- func InitLogger()
- func LoadConfig(configPath string, config *Config) error
- func StartUI(runner *TaskRunner)
- func SummerizeTasks(config *Config, tasks []*Task)
- type ByID
- type Client
- type ColorMap
- type Config
- type NoopNotifier
- type Notifier
- type Pomodoro
- type Server
- type State
- type Status
- type Store
- func (s Store) Close() error
- func (s Store) CreatePomodoro(tx *sql.Tx, taskID int, pomodoro Pomodoro) error
- func (s Store) CreateTask(tx *sql.Tx, task Task) (int, error)
- func (s Store) DeletePomodoros(tx *sql.Tx, taskID int) error
- func (s Store) DeleteTask(tx *sql.Tx, taskID int) error
- func (s Store) ReadPomodoros(tx *sql.Tx, taskID int) ([]*Pomodoro, error)
- func (s Store) ReadTask(tx *sql.Tx, taskID int) (*Task, error)
- func (s Store) ReadTasks(tx *sql.Tx) ([]*Task, error)
- func (s Store) UpdateTask(tx *sql.Tx, taskID int, task Task) error
- func (s Store) With(fns ...func(tx *sql.Tx) error) error
- type StoreFunc
- type Task
- type TaskRunner
- type Wheel
- type Xnotifier
Constants ¶
This section is empty.
Variables ¶
var Version = "undefined"
Functions ¶
func FlushLog ¶
FlushLog writes any buffered log lines to w (typically os.Stderr) and clears the buffer. Safe to call multiple times — no-op when empty.
func FormatStatus ¶
func InitLogger ¶
func InitLogger()
InitLogger routes the standard logger into an in-memory buffer. Call once at program start, before any TUI takes over the terminal.
func LoadConfig ¶
func StartUI ¶
func StartUI(runner *TaskRunner)
func SummerizeTasks ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client makes requests to a listening pomo server to check the status of any currently running task session.
type ColorMap ¶
type ColorMap struct {
// contains filtered or unexported fields
}
func (*ColorMap) MarshalJSON ¶
func (*ColorMap) UnmarshalJSON ¶
type Config ¶
type Config struct {
Colors *ColorMap `json:"colors"`
DateTimeFmt string `json:"dateTimeFmt"`
BasePath string `json:"basePath"`
DBPath string `json:"dbPath"`
SocketPath string `json:"socketPath"`
IconPath string `json:"iconPath"`
OnEvent []string `json:"onEvent"`
// Publish pushes updates to the configured
// SocketPath rather than listening for requests
Publish bool `json:"publish"`
// PublishJson pushes socket updates as a JSON
// encoded status message instead of string formatted
PublishJson bool `json:"publishJson"`
// If Publish is true, provide a socket path to publish to
PublishSocketPath string `json:"publishSocketPath"`
}
Config represents user preferences
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server listens on a Unix domain socket for Pomo status requests
type Status ¶
type Status struct {
TaskID int `json:"task_id"`
TaskMessage string `json:"task_message"`
State State `json:"state"`
Remaining time.Duration `json:"remaining"`
Pauseduration time.Duration `json:"pauseduration"`
Count int `json:"count"`
NPomodoros int `json:"n_pomodoros"`
}
Status is used to communicate the state of a running Pomodoro session
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (Store) CreatePomodoro ¶
func (Store) ReadPomodoros ¶
type Task ¶
type Task struct {
ID int `json:"id"`
Message string `json:"message"`
// Array of completed pomodoros
Pomodoros []*Pomodoro `json:"pomodoros"`
// Free-form tags associated with this task
Tags []string `json:"tags"`
// Number of pomodoros for this task
NPomodoros int `json:"n_pomodoros"`
// Duration of each pomodoro
Duration time.Duration `json:"duration"`
}
Task describes some activity
func Unfinished ¶
Unfinished returns tasks that have not completed all pomodoros.
type TaskRunner ¶
type TaskRunner struct {
// contains filtered or unexported fields
}
func NewMockedTaskRunner ¶
func NewMockedTaskRunner(task *Task, store *Store, notifier Notifier) (*TaskRunner, error)
func NewTaskRunner ¶
func NewTaskRunner(task *Task, config *Config) (*TaskRunner, error)
func (*TaskRunner) Pause ¶
func (t *TaskRunner) Pause()
func (*TaskRunner) SetState ¶
func (t *TaskRunner) SetState(state State)
func (*TaskRunner) Start ¶
func (t *TaskRunner) Start()
func (*TaskRunner) Status ¶
func (t *TaskRunner) Status() *Status
func (*TaskRunner) TimePauseDuration ¶
func (t *TaskRunner) TimePauseDuration() time.Duration
func (*TaskRunner) TimeRemaining ¶
func (t *TaskRunner) TimeRemaining() time.Duration
func (*TaskRunner) Toggle ¶
func (t *TaskRunner) Toggle()
type Xnotifier ¶
type Xnotifier struct {
*notificator.Notificator
// contains filtered or unexported fields
}
Xnotifier can push notifications to mac, linux and windows.