package
1.1.0
Repository: https://github.com/gochrono/chrono.git
Documentation: pkg.go.dev

# Functions

CheckTags returns nil if all tags are valid, otherwise it returns a error.
CompileKeyword converts a given string containing a keyword into its associated time.Time.
ContainsMoreThanOneBooleanFlag is a helper method for checking if more than one boolean is true.
ConvertFrameToSimpleFrame converts a frame to a raw frame.
ConvertSimpleFrameToFrame converts a raw frame back to a frame.
EditFile opens a file in an external text editor.
EnsureConfigDirExists makes sure the configDirectory path exists.
FilterFrames filters out a list of frames based on the given FrameFilterOptions.
FilterFramesByTimespan returns only frames that are in the given timespan.
FormatCancelMessage shows a message if the current state is stopped but not saved.
FormatDateHeader returns a time formated with Tuesday 2 January 2006.
FormatEditFrameMessage returns the output when a frame is modified.
FormatFrameDelete shows confirmation messasge to delete a frame.
FormatFrameDescribe shows information about a frame in a consise manner.
FormatFrameLine returns a frame line (all the metadata about a frame except for its notes).
FormatNewFrameMessage returns the output when a new frame is created.
FormatNoFramesMessage returns the output when there is no current frame.
FormatNoNotesMessage returns the output if there are no notes in the current frame.
FormatNoProjectMessage returns the output when there is no current frame.
FormatNoteLine formats a single frame note.
FormatNoteShowLine formats a single frame note for the notes show command.
FormatReportDuration returns the duration currently being viewed in the report command.
FormatReportDurationDate returns the date using format Mon 02 January 2006.
FormatReportProjectTagTotal return the total time spent on a tag for a project.
FormatReportProjectTotal returns the total time spent on a project.
FormatStartCurrentFrame returns the output when a new frame is created.
FormatStartError returns a message formated red that says a project is already started.
FormatStartFrame returns the output when a new frame is created.
FormatStatusFrameMessage returns the output the current status for active frame.
FormatStopFrameMessage returns the output when time tracking for a frame is stopped.
FormatTagNotValid returns a message when a time string was unable to be parsed.
FormatTags joins tags together and color them blue.
FormatTimeStringNotValid returns a message when a time string was unable to be parsed.
FramesEqual check if frames are equal.
GetAppFilePath returns a file's path in the config directory through either an environment variable or the default path.
GetConfig loads the a confi file if it exists and returns a ChronoConfig struct.
GetCorrectConfigDirectory returns the correct config path where customConfigPath > Env Variable > Default value.
GetEditorEnv returns the preferred text editor's binary name.
GetFrameByShortHex gets a frame using the short form of its UUID.
GetFrames writes frames.
GetShortHex returns the first six characters from a hex encoded SHA.
GetState retrieves the state.
GetTimeElapsed calculates the delta between two Times and returns the hours, minutes, and seconds for that delta.
GetTimeElapsedForDuration returns the hours, minutes, seconds for a given duration.
GetTimespanForMonth returns the start and end date for the current month.
GetTimespanForToday returns the the start date and end date of today.
GetTimespanForWeek returns the start and end date for the current week.
GetTimespanForYear returns the start and end date for the current year.
GetTimespanForYesterday returns the start and end date for yesterday.
HasSameDate checks if the date (month, year, day) are the same.
IsFrameInTimespan checks if a frame's start and end time are both in the given timespan.
IsKeyword checks if given target string is a valid keyword.
IsTimeInTimespan checks if point is inside the timespan between start and end.
IsTimespanNegative returns true if a timespan has a negative amount of time, false otherwise.
NewErrFileDoesNotExist creates a new ErrFileDoesNotExist.
NewErrFrameNotFound creates a new ErrFrameNotFound.
NewErrFramesFileDoesNotExist creates a new ErrFileDoesNotExist.
NormalizeDate strips hours, minutes, and seconds from a given time.
NormalizeTags tags (trims the prefix, lowercases, and replaces spaces with dashes).
OrganizeFrameByTime returns a map of frames where the key is the date of the frame.
PrettyDate returns the date using format 2 January 2006 15:04.
RenderCurrentFrameStatus returns the status output using Go template string.
RenderStatusFormatString returns the status output using Go template string.
SaveFrames writes frames.
SaveState writes the state to the file.
SortFramesByDate sorts frame by its start date.
SortTimeMapKeys sorts a timemap by its key (a time.Time).
StringInSlice checks if a string is present in a slice.

# Constants

ChronoAppConf is the name of the app's data directory.
ChronoConfDirEnvName is name of the environment variable used to manually set the config directory.
ChronoConfigFilename is the config's expected filename.

# Variables

NoColor if set to false will no color any output with ANSI color codes.

# Structs

ChronoConfig contains the currently used config dir path as well as any configuration options stored in config.toml.
CurrentFrame contains data for the current frame.
Data is a wrapper for frames.
ErrFileDoesNotExist represents when a file doesn't exist on the file system.
ErrFrameNotFound means a frame wasn't found.
ErrFramesFileDoesNotExist represents when a file doesn't exist on the file system.
ErrStateFileDoesNotExist represents when a file doesn't exist on the file system.
Frame is a timespan containing some metadata.
FrameDeleteOptions contains data needed to remove a frame.
FrameFilterOptions contains filtering data for retrieving frames.
FrameGetOptions contains filtering information needed to find a single Frame.
Frames contains recordered frames.
GithubLatestRelease represents the data returned from the releases/latest endpoint.
JSONFramesRepo stores state in the JSON format.
JSONStateRepo retrieves state in msgpack format.
MsgpackFramesRepo retrieves state in msgpack format.
MsgpackStateRepo retrieves state in msgpack format.
SimpleFrame is used for converting to and from JSON.
State contains the CurrentFrame and provides methods for interacting with it.
TimespanFilterOptions contains a start and end date to filter frames by.

# Interfaces

FramesRepo is an interface for loading/saving frames.
FrameStorage is an interface for a frame storage backend.
StateRepo is an interface for retieving current state.
StateStorage is an interface for the current frame storage backend.