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"
Defaults on Linux, MacOS
const DefaultTerm = "xterm"
Variables ¶
var TemplateString = `` /* 516-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 Similar to visudo, will do some basic checks to ensure that any edits will still pass toml.Marshal() and that there are no duplicate IDs should return true, err to ask the caller to re-run Edit()
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"` Ignore bool `json:"ignore,omitempty"` Start time.Time `json:"start,omitempty"` End time.Time `json:"end,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"` End time.Time `toml:"end"` 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.