Documentation
¶
Index ¶
- type ClientGateway
- type ClientService
- type ClientsByName
- type DaySection
- type GetProjectsOpts
- type IntervalSection
- type ProjectGateway
- type ProjectKey
- type ProjectSection
- type ProjectService
- func (p *ProjectService) CreateProject(projectName string, clientID int64) error
- func (p *ProjectService) GetProjects(filter *GetProjectsOpts) (TogglProjects, error)
- func (p *ProjectService) ParseProjectTitle(project string) (ProjectTitle, error)
- func (p *ProjectService) ValidProjectName(name string) bool
- type ProjectTitle
- type ProjectsByName
- type Report
- type ReportRange
- type ReportService
- type TimeEntryGateway
- type TimeService
- type TogglClientElement
- type TogglClients
- type TogglProjectElement
- type TogglProjects
- type TogglTimeEntries
- type TogglTimeEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientGateway ¶
type ClientGateway interface {
GetClients(filter string) (TogglClients, error)
}
type ClientService ¶
type ClientService struct {
ClientGateway ClientGateway
}
func NewClientService ¶
func NewClientService(clientGateway ClientGateway) ClientService
func (*ClientService) GetClients ¶
func (c *ClientService) GetClients(filter string) (TogglClients, error)
type ClientsByName ¶
type ClientsByName TogglClients
ByName implements sort.Interface based on the Name field of TogglClientElement.
func (ClientsByName) Len ¶
func (a ClientsByName) Len() int
func (ClientsByName) Less ¶
func (a ClientsByName) Less(i, j int) bool
func (ClientsByName) Swap ¶
func (a ClientsByName) Swap(i, j int)
type DaySection ¶
type DaySection struct { Date time.Time IntervalSections []*IntervalSection }
func NewDaySection ¶
func NewDaySection() *DaySection
func (*DaySection) Duration ¶
func (d *DaySection) Duration() float64
type GetProjectsOpts ¶
type GetProjectsOpts struct {
Name string
}
type IntervalSection ¶
type IntervalSection struct { StartDateTime time.Time EndDateTime time.Time Description string Duration float64 }
func (*IntervalSection) DurationS ¶
func (i *IntervalSection) DurationS() string
type ProjectGateway ¶
type ProjectGateway interface { GetProjects(filter *GetProjectsOpts) (TogglProjects, error) CreateProject(projectName string, clientID int64) error }
type ProjectKey ¶
type ProjectSection ¶
type ProjectSection struct { TaskID int IsTask bool ClientID string ProjectID string Client string Project string DaySections []*DaySection }
func NewProjectSection ¶
func NewProjectSection() *ProjectSection
func (*ProjectSection) Duration ¶
func (p *ProjectSection) Duration() float64
type ProjectService ¶
type ProjectService struct {
ProjectGateway ProjectGateway
}
func NewProjectService ¶
func NewProjectService(projectGateway ProjectGateway) ProjectService
func (*ProjectService) CreateProject ¶
func (p *ProjectService) CreateProject(projectName string, clientID int64) error
func (*ProjectService) GetProjects ¶
func (p *ProjectService) GetProjects(filter *GetProjectsOpts) (TogglProjects, error)
func (*ProjectService) ParseProjectTitle ¶
func (p *ProjectService) ParseProjectTitle(project string) (ProjectTitle, error)
func (*ProjectService) ValidProjectName ¶
func (p *ProjectService) ValidProjectName(name string) bool
type ProjectTitle ¶
type ProjectsByName ¶
type ProjectsByName TogglProjects
ProjectsByName implements sort.Interface based on the Name field of TogglClientElement.
func (ProjectsByName) Len ¶
func (a ProjectsByName) Len() int
func (ProjectsByName) Less ¶
func (a ProjectsByName) Less(i, j int) bool
func (ProjectsByName) Swap ¶
func (a ProjectsByName) Swap(i, j int)
type Report ¶
type Report struct { StartDate time.Time EndDate time.Time ProjectSections []*ProjectSection }
type ReportRange ¶
type ReportRange int
const ( Today ReportRange = iota Yesterday LastWeek ThisWeek Custom EYesterday )
type ReportService ¶
type ReportService struct {
// contains filtered or unexported fields
}
func NewReportService ¶
func NewReportService(timeService TimeService, projectService ProjectService) ReportService
type TimeEntryGateway ¶
type TimeEntryGateway interface {
GetTimeEntries(start, end time.Time) (TogglTimeEntries, error)
}
type TimeService ¶
type TimeService struct {
// contains filtered or unexported fields
}
func NewTimeService ¶
func NewTimeService(timeEntryGateway TimeEntryGateway, clientService ClientService, projectService ProjectService) TimeService
func (*TimeService) GetTimeEntries ¶
func (t *TimeService) GetTimeEntries(start, end time.Time) (TogglTimeEntries, error)
type TogglClientElement ¶
type TogglClients ¶
type TogglClients []*TogglClientElement
type TogglProjectElement ¶
type TogglProjectElement struct { ID int64 `json:"id"` WorkspaceID int64 `json:"workspace_id"` ClientID int64 `json:"client_id"` Name string `json:"name"` IsPrivate bool `json:"is_private"` Active bool `json:"active"` At string `json:"at"` CreatedAt string `json:"created_at"` ServerDeletedAt interface{} `json:"server_deleted_at"` Color string `json:"color"` Billable interface{} `json:"billable"` Template interface{} `json:"template"` AutoEstimates interface{} `json:"auto_estimates"` EstimatedHours interface{} `json:"estimated_hours"` Rate interface{} `json:"rate"` RateLastUpdated interface{} `json:"rate_last_updated"` Currency interface{} `json:"currency"` Recurring bool `json:"recurring"` RecurringParameters interface{} `json:"recurring_parameters"` CurrentPeriod interface{} `json:"current_period"` FixedFee interface{} `json:"fixed_fee"` ActualHours int64 `json:"actual_hours"` // Derived Client string }
type TogglProjects ¶
type TogglProjects []*TogglProjectElement
type TogglTimeEntries ¶
type TogglTimeEntries []*TogglTimeEntry
type TogglTimeEntry ¶
type TogglTimeEntry struct { ID int64 `json:"id"` WorkspaceID int64 `json:"workspace_id"` ProjectID int64 `json:"project_id"` TaskID int64 `json:"task_id"` Billable bool `json:"billable"` Start time.Time `json:"start"` Stop time.Time `json:"stop"` Duration int64 `json:"duration"` Description string `json:"description"` ServerDeletedAt interface{} `json:"server_deleted_at"` // Fields populated by IncludeMissingV9Fields Client string ClientID int64 Project string }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.