Documentation ¶
Index ¶
- Variables
- type EntryFacade
- func (f *EntryFacade) Create(start time.Time, dur time.Duration, note string) (types.Entry, error)
- func (f *EntryFacade) Delete(hash string) (types.Entry, error)
- func (f *EntryFacade) UpdateDuration(hash string, duration time.Duration) (types.Entry, error)
- func (f *EntryFacade) UpdateDurationByOffset(hash string, offset time.Duration) (types.Entry, error)
- func (f *EntryFacade) UpdateNote(hash string, note string) (types.Entry, error)
- type Factory
- type TimesheetFacade
- type TrackingFacade
- type WorkspaceFacade
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoTimerRunning is an error reported when an action is attempted that requires a timer to // be running, but there is no timer running. ErrNoTimerRunning = errors.New("tracking: There is no active timer running") // ErrTimerRunning is an error reported when an action is attempted that requires that no timer // is running, but there is one running. ErrTimerRunning = errors.New("tracking: Stop your existing timer before starting a new one") )
Functions ¶
This section is empty.
Types ¶
type EntryFacade ¶
type EntryFacade struct {
// contains filtered or unexported fields
}
EntryFacade provides a simpler interface for common Entry-related tasks.
func NewEntryFacade ¶
func NewEntryFacade(sysGateway state.SysGateway, trackingGateway state.TrackingGateway) *EntryFacade
NewEntryFacade creates a new EntryFacade instance.
func (*EntryFacade) Delete ¶
func (f *EntryFacade) Delete(hash string) (types.Entry, error)
Delete deletes persisted data for a timesheet entry with the given hash.
func (*EntryFacade) UpdateDuration ¶
UpdateDuration updates an entry with the given hash with the given duration.
func (*EntryFacade) UpdateDurationByOffset ¶
func (f *EntryFacade) UpdateDurationByOffset(hash string, offset time.Duration) (types.Entry, error)
UpdateDurationByOffset updates an entry with the given hash, offsetting the duration by the given offset duration.
func (*EntryFacade) UpdateNote ¶
UpdateNote updates an entry with the given hash with the given note.
type Factory ¶
type Factory interface { // BuildEntryFacade builds an EntryFacade instance. BuildEntryFacade() *EntryFacade // BuildTimesheetFacade builds an TimesheetFacade instance. BuildTimesheetFacade() *TimesheetFacade // BuildTrackingFacade builds a TrackingFacade instance. BuildTrackingFacade() *TrackingFacade // BuildWorkspaceFacade builds a WorkspaceFacade instance. BuildWorkspaceFacade() *WorkspaceFacade // BuildSysGateway builds a SysGateway instance. BuildSysGateway() state.SysGateway // BuildTrackingGateway builds a TimesheetGateway instance. BuildTrackingGateway() state.TrackingGateway }
Factory abstracts the creation of services.
func NewStandardFactory ¶
NewStandardFactory creates a new Factory instance.
type TimesheetFacade ¶
type TimesheetFacade struct {
// contains filtered or unexported fields
}
TimesheetFacade provides a simpler interface for common Timesheet-related tasks.
func NewTimesheetFacade ¶
func NewTimesheetFacade(trGateway state.TrackingGateway, entryFacade *EntryFacade) *TimesheetFacade
NewTimesheetFacade creates a new TimesheetFacade instance.
type TrackingFacade ¶
type TrackingFacade struct {
// contains filtered or unexported fields
}
TrackingFacade provides a simpler interface for common general tracking-related tasks.
func NewTrackingFacade ¶
func NewTrackingFacade(sysGateway state.SysGateway, trGateway state.TrackingGateway) *TrackingFacade
NewTrackingFacade creates a new TrackingFacade instance.
func (*TrackingFacade) Resume ¶
func (f *TrackingFacade) Resume(hash string) (types.Entry, error)
Resume an entry with the given hash. If an empty hash is given, resume the currently active timer. If no timer is active, error.
type WorkspaceFacade ¶
type WorkspaceFacade struct {
// contains filtered or unexported fields
}
WorkspaceFacade provides a simpler interface for common general workspace-related tasks.
func NewWorkspaceFacade ¶
func NewWorkspaceFacade(backend state.Backend, sysGateway state.SysGateway) *WorkspaceFacade
NewWorkspaceFacade creates a new WorkspaceFacade instance.
func (*WorkspaceFacade) Create ¶
func (f *WorkspaceFacade) Create(name string) error
Create attempts to create a new workspace.
func (*WorkspaceFacade) Delete ¶
func (f *WorkspaceFacade) Delete(name string) error
Delete attempts to delete a workspace.
func (*WorkspaceFacade) Switch ¶
func (f *WorkspaceFacade) Switch(name string) error
Switch attempts to switch to another workspace.