tracker

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2015 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Now = time.Now()

Functions

This section is empty.

Types

type Day

type Day struct {
	Start  time.Time `json:"start"`
	Tasks  []Task    `json:"tasks"`
	Pauses []Pause   `json:"pauses"`
}

func (*Day) Duration

func (d *Day) Duration() time.Duration

func (*Day) Pause

func (d *Day) Pause() error

func (*Day) Resume

func (d *Day) Resume() error

func (*Day) SameDay

func (d *Day) SameDay() bool

func (*Day) Status

func (d *Day) Status() string

func (*Day) Task

func (d *Day) Task(desc string) error

type Days

type Days []Day

func (Days) Len

func (slice Days) Len() int

func (Days) Less

func (slice Days) Less(a, b int) bool

func (Days) Swap

func (slice Days) Swap(a, b int)

type Pause

type Pause struct {
	Start time.Time `json:"start"`
	End   time.Time `json:"end"`
}

type Task

type Task struct {
	End         time.Time `json:"end"`
	Description string    `json:"description"`
}

type Tracker

type Tracker struct {
	Name string
	Days map[string]Day
}

func New

func New(filename string) (*Tracker, error)

func (*Tracker) NewDay

func (t *Tracker) NewDay() (Day, error)

func (*Tracker) Save

func (t *Tracker) Save() error

func (*Tracker) SaveDay

func (t *Tracker) SaveDay(d Day)

func (*Tracker) ToJSON added in v1.1.0

func (t *Tracker) ToJSON() error

func (*Tracker) Today

func (t *Tracker) Today() (Day, error)

Jump to

Keyboard shortcuts

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