Documentation ¶
Index ¶
- Variables
- func CRUD(timesheetFn func(), databaseFn func())
- func CheckError(message string, err error)
- func CheckSelection(rowNums []int) int
- func ConfirmInput(action string) string
- func FormatFlags(cmd *cobra.Command) (string, string, string)
- func GetCWD() string
- func GetTimesheetByDFlags(month string, modify bool, year string) (*os.File, error)
- func NoMatchesError(dayOrDate string, month string, year string)
Constants ¶
This section is empty.
Variables ¶
View Source
var AmendArt string = BoldWhite.Sprint(`
_
___ _____ ___ ___ _| |
| .'| | -_| | . |
|__,|_|_|_|___|_|_|___|
`)
View Source
var CurrentDate string = time.Now().Format("01-02-2006")
View Source
var CurrentMonth string = time.Now().Format("January")
View Source
var CurrentYear string = time.Now().Format("2006")
View Source
var DeleteArt string = BoldWhite.Sprint(`
_ _ _
_| |___| |___| |_ ___
| . | -_| | -_| _| -_|
|___|___|_|___|_| |___|
`)
View Source
var ErrorArt string = BoldRed.Sprint(`
___
| -_|
|___|
`)
View Source
var InArt string = BoldWhite.Sprint(`
_
|_|___
| | |
|_|_|_|
`)
View Source
var ListArt string = BoldWhite.Sprint(`
_ _ _
| |_|___| |_
| | |_ -| _|
|_|_|___|_|
`)
View Source
var OutArt string = BoldWhite.Sprint(`
_
___ _ _| |_
| . | | | _|
|___|___|_|
`)
View Source
var StatusArt string = BoldWhite.Sprint(`
_ _
___| |_ ___| |_ _ _ ___
|_ -| _| .'| _| | |_ -|
|___|_| |__,|_| |___|___|
`)
View Source
var StorageArt string = BoldWhite.Sprint(`
_
___| |_ ___ ___ ___ ___ ___
|_ -| _| . | _| .'| . | -_|
|___|_| |___|_| |__,|_ |___|
|___|
`)
View Source
var VersionArt string = BoldWhite.Sprint(`
_ _ ___ _
___| |_|_| _| |_
|_ -| | | _| _|
|___|_|_|_|_| |_| v1.0.0
`)
Functions ¶
func CRUD ¶
func CRUD(timesheetFn func(), databaseFn func())
Main CRUD switch execute the timesheet or database function depending on the `storage-type` value set in `.shiftconfig.yml`.
func CheckError ¶
Check if there is an error. Panic if an error is not `nil`.
func CheckSelection ¶
Check if the selection pointing to a target shift is valid.
func FormatFlags ¶
Get the `dayOrDate`, `month`, and `year` parameters from flag input.
func GetTimesheetByDFlags ¶
Get the timesheet based on the values set by date-related flags.
func NoMatchesError ¶
Format and then display the error message if no matches were found.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.