Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllTimeHandler ¶
type AllTimeHandler struct {
// contains filtered or unexported fields
}
func NewAllTimeHandler ¶
func NewAllTimeHandler(userService services.IUserService, summaryService services.ISummaryService) *AllTimeHandler
func (*AllTimeHandler) Get ¶
func (h *AllTimeHandler) Get(w http.ResponseWriter, r *http.Request)
@Summary Retrieve summary for all time @Description Mimics https://wakatime.com/developers#all_time_since_today @ID get-all-time @Tags wakatime @Produce json @Param user path string true "User ID to fetch data for (or 'current')" @Security ApiKeyAuth @Success 200 {object} v1.AllTimeViewModel @Router /compat/wakatime/v1/users/{user}/all_time_since_today [get]
func (*AllTimeHandler) RegisterRoutes ¶
func (h *AllTimeHandler) RegisterRoutes(router chi.Router)
type HeartbeatHandler ¶
type HeartbeatHandler struct {
// contains filtered or unexported fields
}
func NewHeartbeatHandler ¶
func NewHeartbeatHandler(userService services.IUserService, heartbeatService services.IHeartbeatService) *HeartbeatHandler
func (*HeartbeatHandler) Get ¶
func (h *HeartbeatHandler) Get(w http.ResponseWriter, r *http.Request)
@Summary Get heartbeats of user for specified date @ID get-heartbeats @Tags heartbeat @Param date query string true "Date" @Param user path string true "Username (or current)" @Security ApiKeyAuth @Success 200 {object} HeartbeatsResult @Failure 400 {string} string "bad date" @Router /compat/wakatime/v1/users/{user}/heartbeats [get]
func (*HeartbeatHandler) RegisterRoutes ¶
func (h *HeartbeatHandler) RegisterRoutes(router chi.Router)
type HeartbeatsResult ¶
type HeartbeatsResult struct { Data []*wakatime.HeartbeatEntry `json:"data"` End string `json:"end"` Start string `json:"start"` Timezone string `json:"timezone"` }
type LeadersHandler ¶
type LeadersHandler struct {
// contains filtered or unexported fields
}
func NewLeadersHandler ¶
func NewLeadersHandler(userService services.IUserService, leaderboardService services.ILeaderboardService) *LeadersHandler
func (*LeadersHandler) Get ¶
func (h *LeadersHandler) Get(w http.ResponseWriter, r *http.Request)
@Summary List of users ranked by coding activity in descending order. @Description Mimics https://wakatime.com/developers#leaders @ID get-wakatime-leaders @Tags wakatime @Produce json @Security ApiKeyAuth @Success 200 {object} v1.LeadersViewModel @Router /compat/wakatime/v1/leaders [get]
func (*LeadersHandler) RegisterRoutes ¶
func (h *LeadersHandler) RegisterRoutes(router chi.Router)
type ProjectsHandler ¶
type ProjectsHandler struct {
// contains filtered or unexported fields
}
func NewProjectsHandler ¶
func NewProjectsHandler(userService services.IUserService, heartbeatsService services.IHeartbeatService) *ProjectsHandler
func (*ProjectsHandler) Get ¶
func (h *ProjectsHandler) Get(w http.ResponseWriter, r *http.Request)
@Summary Retrieve and filter the user's projects @Description Mimics https://wakatime.com/developers#projects @ID get-wakatime-projects @Tags wakatime @Produce json @Param user path string true "User ID to fetch data for (or 'current')" @Param q query string false "Query to filter projects by" @Security ApiKeyAuth @Success 200 {object} v1.ProjectsViewModel @Router /compat/wakatime/v1/users/{user}/projects [get]
func (*ProjectsHandler) GetOne ¶
func (h *ProjectsHandler) GetOne(w http.ResponseWriter, r *http.Request)
@Summary Retrieve a single project @Description Mimics undocumented endpoint related to https://wakatime.com/developers#projects @ID get-wakatime-project @Tags wakatime @Produce json @Param user path string true "User ID to fetch data for (or 'current')" @Param id path string true "Project ID to fetch" @Security ApiKeyAuth @Success 200 {object} v1.ProjectViewModel @Router /compat/wakatime/v1/users/{user}/projects/{id} [get]
func (*ProjectsHandler) RegisterRoutes ¶
func (h *ProjectsHandler) RegisterRoutes(router chi.Router)
type StatsHandler ¶
type StatsHandler struct {
// contains filtered or unexported fields
}
func NewStatsHandler ¶
func NewStatsHandler(userService services.IUserService, summaryService services.ISummaryService) *StatsHandler
func (*StatsHandler) Get ¶
func (h *StatsHandler) Get(w http.ResponseWriter, r *http.Request)
@Summary Retrieve statistics for a given user @Description Mimics https://wakatime.com/developers#stats @ID get-wakatimes-tats @Tags wakatime @Produce json @Param user path string true "User ID to fetch data for (or 'current')" @Param range path string false "Range interval identifier" Enums(today, yesterday, week, month, year, 7_days, last_7_days, 30_days, last_30_days, 6_months, last_6_months, 12_months, last_12_months, last_year, any, all_time) @Param project query string false "Project to filter by" @Param language query string false "Language to filter by" @Param editor query string false "Editor to filter by" @Param operating_system query string false "OS to filter by" @Param machine query string false "Machine to filter by" @Param label query string false "Project label to filter by" @Security ApiKeyAuth @Success 200 {object} v1.StatsViewModel @Router /compat/wakatime/v1/users/{user}/stats/{range} [get]
func (*StatsHandler) RegisterRoutes ¶
func (h *StatsHandler) RegisterRoutes(router chi.Router)
type StatusBarHandler ¶
type StatusBarHandler struct {
// contains filtered or unexported fields
}
func NewStatusBarHandler ¶
func NewStatusBarHandler(userService services.IUserService, summaryService services.ISummaryService) *StatusBarHandler
func (*StatusBarHandler) Get ¶
func (h *StatusBarHandler) Get(w http.ResponseWriter, r *http.Request)
@Summary Retrieve summary for statusbar @Description Mimics https://wakatime.com/api/v1/users/current/statusbar/today. Have no official documentation @ID statusbar @Tags wakatime @Produce json @Param user path string true "User ID to fetch data for (or 'current')" @Security ApiKeyAuth @Success 200 {object} StatusBarViewModel @Router /users/{user}/statusbar/today [get]
func (*StatusBarHandler) RegisterRoutes ¶
func (h *StatusBarHandler) RegisterRoutes(router chi.Router)
type StatusBarViewModel ¶
type StatusBarViewModel struct { CachedAt time.Time `json:"cached_at"` Data v1.SummariesData `json:"data"` }
type SummariesHandler ¶
type SummariesHandler struct {
// contains filtered or unexported fields
}
func NewSummariesHandler ¶
func NewSummariesHandler(userService services.IUserService, summaryService services.ISummaryService) *SummariesHandler
func (*SummariesHandler) Get ¶
func (h *SummariesHandler) Get(w http.ResponseWriter, r *http.Request)
@Summary Retrieve WakaTime-compatible summaries @Description Mimics https://wakatime.com/developers#summaries. @ID get-wakatime-summaries @Tags wakatime @Produce json @Param user path string true "User ID to fetch data for (or 'current')" @Param range query string false "Range interval identifier" Enums(today, yesterday, week, month, year, 7_days, last_7_days, 30_days, last_30_days, 6_months, last_6_months, 12_months, last_12_months, last_year, any, all_time) @Param start query string false "Start date (e.g. '2021-02-07')" @Param end query string false "End date (e.g. '2021-02-08')" @Param project query string false "Project to filter by" @Param language query string false "Language to filter by" @Param editor query string false "Editor to filter by" @Param operating_system query string false "OS to filter by" @Param machine query string false "Machine to filter by" @Param label query string false "Project label to filter by" @Security ApiKeyAuth @Success 200 {object} v1.SummariesViewModel @Router /compat/wakatime/v1/users/{user}/summaries [get]
func (*SummariesHandler) RegisterRoutes ¶
func (h *SummariesHandler) RegisterRoutes(router chi.Router)
type UsersHandler ¶
type UsersHandler struct {
// contains filtered or unexported fields
}
func NewUsersHandler ¶
func NewUsersHandler(userService services.IUserService, heartbeatService services.IHeartbeatService) *UsersHandler
func (*UsersHandler) Get ¶
func (h *UsersHandler) Get(w http.ResponseWriter, r *http.Request)
@Summary Retrieve the given user @Description Mimics https://wakatime.com/developers#users @ID get-wakatime-user @Tags wakatime @Produce json @Param user path string true "User ID to fetch (or 'current')" @Security ApiKeyAuth @Success 200 {object} v1.UserViewModel @Router /compat/wakatime/v1/users/{user} [get]
func (*UsersHandler) RegisterRoutes ¶
func (h *UsersHandler) RegisterRoutes(router chi.Router)