Documentation ¶
Index ¶
- Variables
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func FormatStatus(status Status) string
- func InitDB(db *Store) error
- func LoadConfig(configPath string, config *Config) error
- func MustAsset(name string) []byte
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) 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) 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 Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func FormatStatus ¶
func LoadConfig ¶
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
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
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.