Documentation ¶
Index ¶
Constants ¶
const ( // FormatFC indicates that user requested FC report format output FormatFC = iota // FormatJSON indicates that user requested JSON report format output FormatJSON = iota // FormatText indicates that user requested text template report format output FormatText )
const DefaultEditor = "nano"
DefaultEditor on Linux, MacOS
Variables ¶
var TemplateString = `` /* 526-byte string literal not displayed */
TemplateString defines the template used to output a Report() with FormatText
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend represents the context and configuration of every instance of the omw command Immediate commands (like omw add, omw report), immediately affect the timesheet Long-running commands (like omw server), maintain a context
func (*Backend) Edit ¶
Edit opens your current timesheet in your default editor or in the editor specified by the EDITOR environment variable *** TODO: add protection against saving invalid TOML
func (*Backend) Hello ¶
Hello appends a newline and then another line to end of timesheet with current time and the word "Hello". Meant to be run at the beginning of a new work day
func (*Backend) Report ¶
Report outputs various report formats to one of the following types: Text - command-line default JSON - web default FC - web fullcalendar JSON feed URL Add 24 hours to the parsed end time so that when a user specifies --from 2019-01-01 --to 2019-01-02 that translates to "report on tasks that occurred between 2019-01-01 00:00 and "2019-01-03 00:00"
type FCReport ¶
type FCReport struct {
Events []ReportEntry `json:"events"`
}
FCReport describes the format of a FullCalendar-compatible report
type Report ¶
type Report struct { From time.Time `json:"reportFrom"` To time.Time `json:"reportTo"` IgnoreHrs time.Duration `json:"ignoreTotalHours"` BrkHrs time.Duration `json:"breakTotalHours"` TaskHrs time.Duration `json:"taskTotalHours"` Entries []ReportEntry `json:"entries"` // contains filtered or unexported fields }
Report describes a report previous is only used during report calculation to populate ReportEntry.Duration
type ReportEntry ¶
type ReportEntry struct { ID string `json:"id,omitempty"` Brk bool `json:"break,omitempty"` ClassNames []string `json:"classNames,omitempty"` Duration time.Duration `json:"duration,omitempty"` End time.Time `json:"end,omitempty"` Ignore bool `json:"ignore,omitempty"` Start time.Time `json:"start,omitempty"` Title string `json:"title,omitempty"` Ts time.Time `json:"timestamp,omitempty"` URL string `json:"url,omitempty"` }
ReportEntry describes a single entry in the timesheet Omw report and the REST API calculate some of the missing from the data stored on disk.
type SavedEntry ¶
type SavedEntry struct { ID string `toml:"id"` Start time.Time `toml:"start"` Task string `toml:"task"` }
SavedEntry describes the TOML format saved on disk for each entry. Note that the stored data is minimized to make it more suitable for human consumption
type SavedItems ¶
type SavedItems struct {
Entries []SavedEntry `toml:"entries"`
}
SavedItems describes the structure of the entire TOML file.