Documentation
¶
Index ¶
Constants ¶
View Source
const ( USER_AGENT string = "https://github.com/nikoheikkila/hours" BASE_URL string = "https://api.track.toggl.com/reports/api/v2" CONTENT_TYPE string = "application/json" PASSWORD string = "api_token" )
View Source
const ( DATE_LAYOUT string = "02.01.2006" NO_CLIENT string = "No Client" NO_PROJECT string = "No Project" NO_DESCRIPTION string = "No Description" )
Variables ¶
View Source
var ( Client HTTPClient ErrMissingToken error = errors.New("missing Toggl API token for the client") ErrEmptyResponse error = errors.New("empty response from Toggl API") )
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct { Token string `yaml:"api_token"` Workspace string `yaml:"workspace_id"` }
func LoadConfiguration ¶
func LoadConfiguration() (*Configuration, error)
type DetailedReport ¶
type DetailedReport struct { TotalGrand int `json:"total_grand"` TotalBillable int `json:"total_billable"` TotalCount int `json:"total_count"` PerPage int `json:"per_page"` TotalCurrencies []struct { Currency string `json:"currency"` Amount float32 `json:"amount"` } `json:"total_currencies"` Data []TimeEntry `json:"data"` }
type ErrorResponse ¶
type TimeEntry ¶
type TimeEntry struct { Id int `json:"id"` ProjectId int `json:"pid"` TeamId int `json:"tid"` UserId int `json:"uid"` Description string `json:"description"` Start time.Time `json:"start"` End time.Time `json:"end"` Updated time.Time `json:"updated"` Duration int64 `json:"dur"` User string `json:"user"` UseStop bool `json:"use_stop"` Client string `json:"client"` Project string `json:"project"` Color string `json:"project_color"` HexColor string `json:"project_hex_color"` Task string `json:"task"` Billable float32 `json:"billable"` IsBillable bool `json:"is_billable"` Currency string `json:"cur"` Tags []string `json:"tags"` }
func (*TimeEntry) FormatEndDate ¶
func (*TimeEntry) FormatHours ¶
func (*TimeEntry) FormatStartDate ¶
func (*TimeEntry) GetDescription ¶
func (*TimeEntry) GetProject ¶
type TogglClient ¶
type TogglClient struct {
// contains filtered or unexported fields
}
func New ¶
func New(configuration *Configuration) *TogglClient
Click to show internal directories.
Click to hide internal directories.