Documentation ¶
Index ¶
- Variables
- func SystemTimeglassPath() (string, error)
- func SystemTimeglassPathCreateIfNotExist() (string, error)
- type Block
- type Distributor
- func (d *Distributor) Break()
- func (d *Distributor) Distribute(dur time.Duration, t time.Time)
- func (d *Distributor) Extract(fpath string, upto time.Time) (time.Duration, error)
- func (d *Distributor) MarshalJSON() ([]byte, error)
- func (d *Distributor) Register(fpath string)
- func (d *Distributor) Reset(opt ResetOpts)
- func (d *Distributor) Stage(fpath string, upto time.Time)
- func (d *Distributor) Timelines() map[string]*Timeline
- func (d *Distributor) UnmarshalJSON(b []byte) error
- type Keeper
- func (k *Keeper) Discard(dir string) error
- func (k *Keeper) Inspect(dir string) (*Timer, error)
- func (k *Keeper) Load() error
- func (k *Keeper) MarshalJSON() ([]byte, error)
- func (k *Keeper) Measure(dir string) error
- func (k *Keeper) Save() error
- func (k *Keeper) Stop()
- func (k *Keeper) UnmarshalJSON(b []byte) error
- type ResetOpts
- type Timeline
- type Timer
- func (t *Timer) Dir() string
- func (t *Timer) Distributor() *Distributor
- func (t *Timer) Error() error
- func (t *Timer) IsPaused() bool
- func (t *Timer) MarshalJSON() ([]byte, error)
- func (t *Timer) Pause()
- func (t *Timer) Reset(opt ResetOpts)
- func (t *Timer) SetSave(ch chan struct{})
- func (t *Timer) Stage(files []*vcs.StagedFile)
- func (t *Timer) Start()
- func (t *Timer) Stop()
- func (t *Timer) Time() time.Duration
- func (t *Timer) UnmarshalJSON(b []byte) error
- func (t *Timer) Unpause()
Constants ¶
This section is empty.
Variables ¶
View Source
var OverheadTimeline = "__overhead"
Functions ¶
func SystemTimeglassPath ¶
returns the system path were all timeglass related data is stored for this machine
Types ¶
type Block ¶
type Block struct { Staged bool `json:"s"` Width time.Duration `json:"w"` Time time.Time `json:"t"` }
A block of time that is positioned on a timeline
type Distributor ¶
type Distributor struct {
// contains filtered or unexported fields
}
A distributor managed various files for a single timer using timelines
func NewDistributor ¶
func NewDistributor() *Distributor
func (*Distributor) Break ¶
func (d *Distributor) Break()
func (*Distributor) Distribute ¶
func (d *Distributor) Distribute(dur time.Duration, t time.Time)
func (*Distributor) Extract ¶
extract the time spent on a file from the first point a given point in time
func (*Distributor) MarshalJSON ¶
func (d *Distributor) MarshalJSON() ([]byte, error)
func (*Distributor) Register ¶
func (d *Distributor) Register(fpath string)
func (*Distributor) Reset ¶
func (d *Distributor) Reset(opt ResetOpts)
func (*Distributor) Stage ¶
func (d *Distributor) Stage(fpath string, upto time.Time)
stage blocks to be removed on the next .Reset(true)
func (*Distributor) Timelines ¶
func (d *Distributor) Timelines() map[string]*Timeline
func (*Distributor) UnmarshalJSON ¶
func (d *Distributor) UnmarshalJSON(b []byte) error
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func (*Keeper) MarshalJSON ¶
func (*Keeper) UnmarshalJSON ¶
type Timeline ¶
type Timeline struct {
Blocks []*Block `json:"b"`
}
A timeline holds a number of lines for a single file
func NewTimeline ¶
func NewTimeline() *Timeline
type Timer ¶
type Timer struct {
// contains filtered or unexported fields
}
a timer without explicit start and stop methods, let garbage collector remove any routines, channels etc when a refence is removed
func (*Timer) Distributor ¶
func (t *Timer) Distributor() *Distributor
func (*Timer) MarshalJSON ¶
func (*Timer) Stage ¶
func (t *Timer) Stage(files []*vcs.StagedFile)
func (*Timer) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.