Documentation ¶
Index ¶
- func TestCreateResponseHandler(res TestJSONFileResponse, t *testing.T) http.HandlerFunc
- type Client
- func (c *Client) GetDashboardByWorkspaceID(ctx context.Context, wid int) (*Dashboard, error)
- func (c *Client) GetDetailedReport(ctx context.Context, req *DetailedReportRequest) (*DetailedReport, error)
- func (c *Client) GetProjectsByWorkspaceID(ctx context.Context, wid int) ([]Project, error)
- func (c *Client) GetWorkspaceByID(ctx context.Context, wid int) (*Workspace, error)
- func (c *Client) GetWorkspaces(ctx context.Context) ([]Workspace, error)
- type Config
- type Dashboard
- type DetailedReport
- type DetailedReportRequest
- type Project
- type TestJSONFileResponse
- type Workspace
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TestCreateResponseHandler ¶
func TestCreateResponseHandler(res TestJSONFileResponse, t *testing.T) http.HandlerFunc
TestCreateResponseHandler test handler
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client toggl client
func TestNewClient ¶
TestNewClient creates test client
func (*Client) GetDashboardByWorkspaceID ¶
GetDashboardByWorkspaceID gets dashboard
func (*Client) GetDetailedReport ¶
func (c *Client) GetDetailedReport(ctx context.Context, req *DetailedReportRequest) (*DetailedReport, error)
GetDetailedReport gets dashboard
func (*Client) GetProjectsByWorkspaceID ¶
GetProjectsByWorkspaceID get projects by workspace id
func (*Client) GetWorkspaceByID ¶
GetWorkspaceByID gets workspaces
type Config ¶
type Config struct { HTTPClient *http.Client Host string APIKey string Debug bool Logger *log.Logger }
Config toggl client config
type Dashboard ¶
type Dashboard struct { MostActiveUser []struct { UserID int `json:"user_id"` Duration int `json:"duration"` } `json:"most_active_user"` Activity []struct { UserID int `json:"user_id"` ProjectID int `json:"project_id"` Duration int `json:"duration"` Description string `json:"description"` Stop interface{} `json:"stop"` Tid interface{} `json:"tid"` } `json:"activity"` }
Dashboard dashboard
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 float64 `json:"amount"` } `json:"total_currencies"` Data []struct { ID int `json:"id"` Pid int `json:"pid"` Tid interface{} `json:"tid"` UID int `json:"uid"` Description string `json:"description"` Start string `json:"start"` End string `json:"end"` Updated string `json:"updated"` Dur int `json:"dur"` User string `json:"user"` UseStop bool `json:"use_stop"` Client string `json:"client"` Project string `json:"project"` Task interface{} `json:"task"` Billable float64 `json:"billable"` IsBillable bool `json:"is_billable"` Cur string `json:"cur"` Tags []string `json:"tags"` } `json:"data"` }
DetailedReport detailed report
type DetailedReportRequest ¶
type DetailedReportRequest struct { WorkspaceID int Since time.Time Until time.Time UserAgent string }
DetailedReportRequest detailed report request
type Project ¶
type Project struct { ID int `json:"id"` Wid int `json:"wid"` Name string `json:"name"` Billable bool `json:"billable"` IsPrivate bool `json:"is_private"` Active bool `json:"active"` Template bool `json:"template"` At time.Time `json:"at"` CreatedAt time.Time `json:"created_at"` Color string `json:"color"` AutoEstimates bool `json:"auto_estimates"` HexColor string `json:"hex_color"` ActualHours int `json:"actual_hours,omitempty"` }
Project project
type TestJSONFileResponse ¶
TestJSONFileResponse test response
type Workspace ¶
type Workspace struct { ID int `json:"id"` Name string `json:"name"` Profile int `json:"profile"` Premium bool `json:"premium"` Admin bool `json:"admin"` DefaultHourlyRate int `json:"default_hourly_rate"` DefaultCurrency string `json:"default_currency"` OnlyAdminsMayCreateProjects bool `json:"only_admins_may_create_projects"` OnlyAdminsSeeBillableRates bool `json:"only_admins_see_billable_rates"` OnlyAdminsSeeTeamDashboard bool `json:"only_admins_see_team_dashboard"` ProjectsBillableByDefault bool `json:"projects_billable_by_default"` Rounding int `json:"rounding"` RoundingMinutes int `json:"rounding_minutes"` APIToken string `json:"api_token"` At time.Time `json:"at"` IcalEnabled bool `json:"ical_enabled"` }
Workspace workspace
Click to show internal directories.
Click to hide internal directories.