Documentation ¶
Overview ¶
Package console contains code to pretty-print different types to the console.
Index ¶
- func FormatDuration(d time.Duration) string
- func PrintEntryEdit(update dinkur.UpdatedEntry)
- func PrintEntryLabel(labelled LabelledEntry)
- func PrintEntryLabelSlice(slice []LabelledEntry)
- func PrintEntryList(entries []dinkur.Entry)
- func PrintEntryListSearched(entries []dinkur.Entry, searchStart, searchEnd string)
- func PrintFatal(label string, v any)
- func PromptDupEntryResolution(activeEntry dinkur.Entry) (bool, error)
- func PromptEntryRemoval(entry dinkur.Entry) error
- func UsageTemplate() string
- type AFKResolution
- type LabelledEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatDuration ¶
FormatDuration returns a formatted time.Duration in the format of h:mm:ss.
func PrintEntryEdit ¶
func PrintEntryEdit(update dinkur.UpdatedEntry)
PrintEntryEdit writes a formatted entry and highlights any edits made to it, by diffing the before and after entries, to STDOUT.
func PrintEntryLabel ¶
func PrintEntryLabel(labelled LabelledEntry)
PrintEntryLabel writes a label string followed by a formatted entry to STDOUT.
func PrintEntryLabelSlice ¶
func PrintEntryLabelSlice(slice []LabelledEntry)
PrintEntryLabelSlice writes a table of label strings followed by a formatted entry to STDOUT.
func PrintEntryList ¶
PrintEntryList writes a table for a list of entries, grouped by the date (year, month, day), to STDOUT.
func PrintEntryListSearched ¶
PrintEntryListSearched writes a table for a list of entries, grouped by the date (year, month, day), to STDOUT, as well as highlighting search terms (if any).
func PrintFatal ¶
PrintFatal writes a label and some error value to STDERR and then exits the application with status code 1.
func PromptDupEntryResolution ¶
PromptDupEntryResolution asks the user for how to resolve creating a new duplicate entry.
func PromptEntryRemoval ¶
PromptEntryRemoval asks the user for confirmation about removing a entry. Will return an io.EOF error if the current TTY is not an interactive session.
func UsageTemplate ¶
func UsageTemplate() string
UsageTemplate returns a lightly colored usage template for Cobra.
Types ¶
type AFKResolution ¶
AFKResolution states what should be changed as decided from the human's AFK resolution.
func PromptAFKResolution ¶
PromptAFKResolution asks the user for how to resolve an AFK status.