Documentation ¶
Index ¶
Constants ¶
View Source
const IDLE_TITLE string = "<idle>"
Variables ¶
View Source
var ErrDuplicateEntry = errors.New("entry already started")
View Source
var ErrOngoingExists = errors.New("ongoing entry exists")
Functions ¶
Types ¶
type DetailView ¶
type DetailView map[string][]*FinishedEntry
func NewDetail ¶
func NewDetail(entries []FinishedEntry) DetailView
func (DetailView) String ¶
func (d DetailView) String() string
type DistView ¶
type DistView map[string][]*FinishedEntry
func NewDist ¶
func NewDist(entries []FinishedEntry) DistView
type EffortsView ¶
func NewEfforts ¶
func NewEfforts(entries []FinishedEntry) EffortsView
func (EffortsView) String ¶
func (eff EffortsView) String() string
type FinishedEntry ¶
type FinishedEntry struct { *UnfinishedEntry End time.Time }
func (*FinishedEntry) Format ¶
func (entry *FinishedEntry) Format() string
type Store ¶
type Store interface { // Start an entry. // 1. No new entry allowed if there is already an ongoing (unfinished) entry exists. // 2. Entry considered as duplicated and is not allowed to start, // if there is already an entry with the same Title and Start. Start(*UnfinishedEntry) error // StartTitle starts an entry with given title and notes, and 'now' as Start. StartTitle(title, note string) error // Finish finishes the unfinished entry (if any). // If there was one, return it's title. // If no unfinished entry to finish, return empty string. This case is not treated as error. Finish(notes string) (string, error) // RecentTitles returns at most 'limit' number of distinct titles of recent finished entries. RecentTitles(limit uint8) ([]string, error) // Ongoing returns the ongoing entry (if any), otherwise return nil. Ongoing() (*UnfinishedEntry, error) // LastFinished returns the finished entry with the latest Start of given title, if any. Otherwise return nil. LastFinished(title string) (*FinishedEntry, error) // Finished queries entries with condition 'Start >= queryStart and Start <= queryEnd'. // Both queryStart and queryEnd must be UTC time // If 'titles' is not nil, only returns entries with 'title in titles'. Finished(queryStart, queryEnd time.Time, titles []string) ([]FinishedEntry, error) }
func NewSqliteStore ¶
type SummaryView ¶
func NewSummary ¶
func NewSummary(entries []FinishedEntry) SummaryView
func (SummaryView) String ¶
func (s SummaryView) String() string
Click to show internal directories.
Click to hide internal directories.