Documentation
¶
Index ¶
- Constants
- func ConfirmDelete(frame chronolib.Frame) bool
- func Execute()
- func GetAdjustedTime(t time.Time) time.Time
- func GetFrame(frames chronolib.Frames, target string) (chronolib.Frame, bool)
- func GetToFromTimespan(from string, to string) (chronolib.TimespanFilterOptions, error)
- func ParseStartArgs(args []string, startAt string, startEnded string, startNote string) (chronolib.CurrentFrame, time.Time, error)
- func ParseStartArguments(args []string) (string, []string, error)
- func ParseTime(t string) (time.Time, error)
- func ParseTimespanFlags(timespanFlags TimespanFlags) chronolib.TimespanFilterOptions
- func PrintErrorAndExit(e error)
- type ErrTagNotValid
- type ErrTimeStringNotValid
- type TimespanFlags
Constants ¶
const ChronoAppConf = "chrono"
ChronoAppConf is the name of the app's data directory
const ChronoConfDirEnvName = "CHRONO_CONFIG_DIR"
ChronoConfDirEnvName is name of the environment variable used to manually set the config directory
Variables ¶
This section is empty.
Functions ¶
func ConfirmDelete ¶
ConfirmDelete asks user if they are sure they want to delete the frame
func GetAdjustedTime ¶
GetAdjustedTime rounds a time to a given interval. E.g if the time is 15:02:13 and the interval is 5 minutes it would be rounded to 15:00:00
func GetToFromTimespan ¶
func GetToFromTimespan(from string, to string) (chronolib.TimespanFilterOptions, error)
GetToFromTimespan is a helper function that takes in two time formats and attempts to parse them
func ParseStartArgs ¶
func ParseStartArgs(args []string, startAt string, startEnded string, startNote string) (chronolib.CurrentFrame, time.Time, error)
ParseStartArgs properly handles user arguments for the start command
func ParseStartArguments ¶
ParseStartArguments splits the argument string list and validates tags
func ParseTimespanFlags ¶
func ParseTimespanFlags(timespanFlags TimespanFlags) chronolib.TimespanFilterOptions
ParseTimespanFlags gets the correct start and end time for filtering frames based on the flags given
func PrintErrorAndExit ¶
func PrintErrorAndExit(e error)
PrintErrorAndExit prints an appropriate message depending on the error type. If the error type is unknown, panics
Types ¶
type ErrTagNotValid ¶ added in v1.1.0
type ErrTagNotValid struct {
// contains filtered or unexported fields
}
ErrTagNotValid represents when a file doesn't exist on the file system
func NewErrTagNotValid ¶ added in v1.1.0
func NewErrTagNotValid(message string) *ErrTagNotValid
NewErrTagNotValid return a ErrTimeStringNotValid
func (*ErrTagNotValid) Error ¶ added in v1.1.0
func (e *ErrTagNotValid) Error() string
Error returns the error message
type ErrTimeStringNotValid ¶
type ErrTimeStringNotValid struct {
// contains filtered or unexported fields
}
ErrTimeStringNotValid represents when a file doesn't exist on the file system
func NewErrTimeStringNotValid ¶
func NewErrTimeStringNotValid(message string) *ErrTimeStringNotValid
NewErrTimeStringNotValid return a ErrTimeStringNotValid
func (*ErrTimeStringNotValid) Error ¶
func (e *ErrTimeStringNotValid) Error() string
Error returns the error message