models

package
v0.0.0-...-4d81fc8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FmtDuration

func FmtDuration(d time.Duration) string

FmtDuration formats a duration into hours,minutes and decimal hours for display

func IsTrackingActive

func IsTrackingActive() bool

IstracktingActive idicates whether tracking is currently active

func Tracked

func Tracked() string

Tracked returns the actively tracked project

func TrackingActive

func TrackingActive(p Project)

TrackingActive sets active project

func TrackingInactive

func TrackingInactive()

TrackingInactive turns off project tracking

Types

type Duration

type Duration struct {
	Project string
	Elapsed string
}

Duration holds information about time tracked for a project

type Durations

type Durations map[string]string

Durations is a map of project durations

type Project

type Project struct {
	Name    string
	Active  bool
	Updated time.Time
}

Project is a project that can be tracked

type Record

type Record struct {
	ID      uuid.UUID
	Project string
	Start   time.Time
	End     time.Time
}

Record contains the data for an individual tracking event

func (*Record) Duration

func (r *Record) Duration() time.Duration

Duration returns the duration of an individual tracking event

type Report

type Report struct {
	Project string
	Total   time.Duration
	Items   []ReportRecord
}

Report contains data tracking information for a project

type ReportRecord

type ReportRecord struct {
	Start time.Time
	End   time.Time
}

ReportRecord contians start/end times for an individual tracking event

type ReportRequest

type ReportRequest struct {
	Start    time.Time
	End      time.Time
	Projects []string
}

ReportRequest contains data to retrieve a report

type StartRequest

type StartRequest struct {
	Project string
}

StartRequest is a request to start tracking time for a project

type Status

type Status struct {
	Current    string
	Elapsed    time.Duration
	Total      time.Duration
	DailyTotal time.Duration
}

Status contains a days tracking information

type StatusResponse

type StatusResponse struct {
	Current      string
	Elapsed      string
	CurrentTotal string
	DailyTotal   string
	Durations    []Duration
}

StatusResponse contains a days tracking information for display

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL