Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConfigFile ¶
type ConfigFile struct { Project string `json:"project"` Exists bool `json:"-"` Path string `json:"-"` }
ConfigFile defines the structure of the file used to configure a project
func GetConfig ¶
func GetConfig() (*ConfigFile, error)
GetConfig returns the current configuration of the project you are in
func NewConfigFile ¶
func NewConfigFile(project string) *ConfigFile
NewConfigFile creates a ConfigFile witht the provided name
func (*ConfigFile) Save ¶
func (c *ConfigFile) Save() error
Save stores the ConfigFile to disk on the corresponding path
type Env ¶
Env type holds all the data destinations for 'got'
func NewEnv ¶
NewEnv initialize the Env with all the data, with is read from the system ENV. It follows the https://specifications.freedesktop.org/basedir-spec/latest/ convention
type FilterOption ¶
type FilterOption func(*ReportFilter)
func WithFilterFrom ¶
func WithFilterFrom(f time.Time) FilterOption
func WithFilterProject ¶
func WithFilterProject(p string) FilterOption
func WithFilterTo ¶
func WithFilterTo(t time.Time) FilterOption
type Project ¶
Project hold the data of one Project
type Projects ¶
Projects hold the information of all the known projects initialized. The structure is project_name => path_to_config_file
func GetProjects ¶
GetProjects returns all the Projects from the projects.json file
type Report ¶
type Report struct {
// contains filtered or unexported fields
}
Report holds all the projects aggregated
func NewReport ¶
func NewReport(e *Env, rf *ReportFilter) (*Report, error)
NewReport initializes a new reporter and populates it
type ReportFilter ¶
func NewReportFilter ¶
func NewReportFilter(filters ...FilterOption) (*ReportFilter, error)
type Task ¶
type Task struct { Description string `json:"description,omitempty"` Project string `json:"project"` Start *time.Time `json:"start"` Stop *time.Time `json:"stop,omitempty"` Seconds int `json:"seconds,omitempty"` }
Task holds the information of a task that you have workder (or currently working)
func NewTaskFromCurrent ¶
NewTaskFromCurrent loads the current task working on (on the 'current' file)
func NewTaskFromPath ¶
NewTaskFromPath loads a task from a path
func (*Task) PathToTask ¶
PathToTask returns the path in which the Task is
func (*Task) StartWorking ¶
StartWorking saves the Task and sets it to the 'current'
func (*Task) StopWorking ¶
StopWorking sets the task as finished and removes the 'current'