Documentation
¶
Index ¶
- Constants
- Variables
- func GetShiftedTime(ts time.Time, direction TimeShiftDirection, duration TimeShiftDuration) time.Time
- func HumanizeDuration(durationInSecs int) string
- func IsTaskLogDurationValid(begin, end time.Time) error
- func ParseTaskLogTimes(beginStr, endStr string) (time.Time, time.Time, error)
- type ActiveTaskDetails
- type ActiveTaskLogEntry
- type DateRange
- type RealTimeProvider
- type Task
- type TaskLogEntry
- type TaskReportEntry
- type TaskStatus
- type TestTimeProvider
- type TimeProvider
- type TimeShiftDirection
- type TimeShiftDuration
Constants ¶
View Source
const ( TSValueActive = "active" TSValueInactive = "inactive" TSValueAny = "any" )
View Source
const (
TimePeriodWeek = "week"
)
Variables ¶
View Source
var ErrIncorrectTaskStatusProvided = errors.New("incorrect task status provided")
View Source
var ValidTaskStatusValues = []string{TSValueActive, TSValueInactive, TSValueAny}
Functions ¶
func GetShiftedTime ¶
func GetShiftedTime(ts time.Time, direction TimeShiftDirection, duration TimeShiftDuration) time.Time
func HumanizeDuration ¶
func IsTaskLogDurationValid ¶ added in v0.6.0
Types ¶
type ActiveTaskDetails ¶
type ActiveTaskLogEntry ¶
type RealTimeProvider ¶ added in v0.6.0
type RealTimeProvider struct{}
func (RealTimeProvider) Now ¶ added in v0.6.0
func (RealTimeProvider) Now() time.Time
type Task ¶
type Task struct {
ID int
Summary string
CreatedAt time.Time
UpdatedAt time.Time
TrackingActive bool
SecsSpent int
Active bool
ListTitle string
ListDesc string
}
func (Task) Description ¶
func (Task) FilterValue ¶
func (*Task) UpdateListDesc ¶
func (t *Task) UpdateListDesc(timeProvider TimeProvider)
func (*Task) UpdateListTitle ¶
func (t *Task) UpdateListTitle()
type TaskLogEntry ¶
type TaskLogEntry struct {
ID int
TaskID int
TaskSummary string
BeginTS time.Time
EndTS time.Time
SecsSpent int
Comment *string
ListTitle string
ListDesc string
}
func (TaskLogEntry) Description ¶
func (tl TaskLogEntry) Description() string
func (TaskLogEntry) FilterValue ¶
func (tl TaskLogEntry) FilterValue() string
func (*TaskLogEntry) GetComment ¶
func (tl *TaskLogEntry) GetComment() string
func (TaskLogEntry) Title ¶
func (tl TaskLogEntry) Title() string
func (*TaskLogEntry) UpdateListDesc ¶
func (tl *TaskLogEntry) UpdateListDesc(timeProvider TimeProvider)
func (*TaskLogEntry) UpdateListTitle ¶
func (tl *TaskLogEntry) UpdateListTitle()
type TaskReportEntry ¶
type TaskStatus ¶ added in v0.6.0
type TaskStatus uint8
const ( TaskStatusActive TaskStatus = iota TaskStatusInactive TaskStatusAny )
func ParseTaskStatus ¶ added in v0.6.0
func ParseTaskStatus(value string) (TaskStatus, error)
type TestTimeProvider ¶ added in v0.6.0
func (TestTimeProvider) Now ¶ added in v0.6.0
func (t TestTimeProvider) Now() time.Time
type TimeProvider ¶ added in v0.6.0
type TimeShiftDirection ¶
type TimeShiftDirection uint8
const ( ShiftForward TimeShiftDirection = iota ShiftBackward )
type TimeShiftDuration ¶
type TimeShiftDuration uint8
const ( ShiftMinute TimeShiftDuration = iota ShiftFiveMinutes ShiftHour ShiftDay )
Click to show internal directories.
Click to hide internal directories.