Documentation ¶
Index ¶
Constants ¶
const ( MetricsPrefix = "wakatime" DescHeartbeats = "Total number of tracked heartbeats." DescAllTime = "Total seconds (all time)." DescTotal = "Total seconds." DescEditors = "Total seconds for each editor." DescProjects = "Total seconds for each project." DescLanguages = "Total seconds for each language." DescOperatingSystems = "Total seconds for each operating system." DescMachines = "Total seconds for each machine." DescLabels = "Total seconds for each project label." DescCategories = "Total seconds for each category." DescRank = "User's current rank in the public leaderboard." DescAdminTotalTime = "Total seconds (all users, all time)." DescAdminTotalHeartbeats = "Total number of tracked heartbeats (all users, all time)" DescAdminUserHeartbeats = "Total number of tracked heartbeats by user (all time)." DescAdminUserTime = "Total tracked activity in seconds (all time) (active users only)." DescAdminTotalUsers = "Total number of registered users." DescAdminActiveUsers = "Number of active users." DescJobQueueEnqueued = "Number of jobs currently enqueued" DescJobQueueTotalFinished = "Total number of processed jobs" DescMemAlloc = "Total number of bytes currently allocated for heap" DescMemSys = "Total number of bytes currently obtained from the OS" DescMemHeapSys = "Total number of bytes currently obtained from the OS for heap" DescMemHeapIdle = "Total number of bytes currently allocated for heap but unused" DescMemHeapReleased = "Total number of idling heap memory in bytes released back to the OD" DescMemHeapInuse = "Total number of bytes currently allocated and used for heap" DescMemStackSys = "Total number of bytes currently obtained from the OS for stack" DescMemStackInuse = "Total number of bytes currently allocated and used for stack" DescPausedTotal = "Total cumulative nanoseconds stop-the-world pause time due to GC" DescNumGCTotal = "Total cumulative number of GC cycles" DescGoroutines = "Total number of currently running goroutines" DescDatabaseSize = "Total database size in bytes" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActivityApiHandler ¶
type ActivityApiHandler struct {
// contains filtered or unexported fields
}
func NewActivityApiHandler ¶
func NewActivityApiHandler(userService services.IUserService, activityService services.IActivityService) *ActivityApiHandler
func (*ActivityApiHandler) GetActivityChart ¶
func (h *ActivityApiHandler) GetActivityChart(w http.ResponseWriter, r *http.Request)
func (*ActivityApiHandler) RegisterRoutes ¶
func (h *ActivityApiHandler) RegisterRoutes(router chi.Router)
type AvatarHandler ¶
type AvatarHandler struct {
// contains filtered or unexported fields
}
func NewAvatarHandler ¶
func NewAvatarHandler() *AvatarHandler
func (*AvatarHandler) Get ¶
func (h *AvatarHandler) Get(w http.ResponseWriter, r *http.Request)
func (*AvatarHandler) RegisterRoutes ¶
func (h *AvatarHandler) RegisterRoutes(router chi.Router)
type BadgeHandler ¶
type BadgeHandler struct {
// contains filtered or unexported fields
}
func NewBadgeHandler ¶
func NewBadgeHandler(userService services.IUserService, summaryService services.ISummaryService) *BadgeHandler
func (*BadgeHandler) Get ¶
func (h *BadgeHandler) Get(w http.ResponseWriter, r *http.Request)
func (*BadgeHandler) RegisterRoutes ¶
func (h *BadgeHandler) RegisterRoutes(router chi.Router)
type CaptchaHandler ¶
type CaptchaHandler struct {
// contains filtered or unexported fields
}
func NewCaptchaHandler ¶
func NewCaptchaHandler() *CaptchaHandler
func (*CaptchaHandler) RegisterRoutes ¶
func (h *CaptchaHandler) RegisterRoutes(router chi.Router)
type DiagnosticsApiHandler ¶
type DiagnosticsApiHandler struct {
// contains filtered or unexported fields
}
func NewDiagnosticsApiHandler ¶
func NewDiagnosticsApiHandler(userService services.IUserService, diagnosticsService services.IDiagnosticsService) *DiagnosticsApiHandler
func (*DiagnosticsApiHandler) Post ¶
func (h *DiagnosticsApiHandler) Post(w http.ResponseWriter, r *http.Request)
@Summary Push a new diagnostics object @ID post-diagnostics @Tags diagnostics @Accept json @Param diagnostics body models.Diagnostics true "A single diagnostics object sent by WakaTime CLI" @Success 201 @Router /plugins/errors [post]
func (*DiagnosticsApiHandler) RegisterRoutes ¶
func (h *DiagnosticsApiHandler) RegisterRoutes(router chi.Router)
type HealthApiHandler ¶
type HealthApiHandler struct {
// contains filtered or unexported fields
}
func NewHealthApiHandler ¶
func NewHealthApiHandler(db *gorm.DB) *HealthApiHandler
func (*HealthApiHandler) Get ¶
func (h *HealthApiHandler) Get(w http.ResponseWriter, r *http.Request)
@Summary Check the application's health status @ID get-health @Tags misc @Produce plain @Success 200 {string} string @Router /health [get]
func (*HealthApiHandler) RegisterRoutes ¶
func (h *HealthApiHandler) RegisterRoutes(router chi.Router)
type HeartbeatApiHandler ¶
type HeartbeatApiHandler struct {
// contains filtered or unexported fields
}
func NewHeartbeatApiHandler ¶
func NewHeartbeatApiHandler(userService services.IUserService, heartbeatService services.IHeartbeatService, languageMappingService services.ILanguageMappingService) *HeartbeatApiHandler
func (*HeartbeatApiHandler) Post ¶
func (h *HeartbeatApiHandler) Post(w http.ResponseWriter, r *http.Request)
@Summary Push a new heartbeat @ID post-heartbeat @Tags heartbeat @Accept json @Param heartbeat body models.Heartbeat true "A single heartbeat" @Security ApiKeyAuth @Success 201 @Router /heartbeat [post]
func (*HeartbeatApiHandler) RegisterRoutes ¶
func (h *HeartbeatApiHandler) RegisterRoutes(router chi.Router)
type MetricsHandler ¶
type MetricsHandler struct {
// contains filtered or unexported fields
}
func NewMetricsHandler ¶
func NewMetricsHandler(userService services.IUserService, summaryService services.ISummaryService, heartbeatService services.IHeartbeatService, leaderboardService services.ILeaderboardService, keyValueService services.IKeyValueService, metricsRepo *repositories.MetricsRepository) *MetricsHandler
func (*MetricsHandler) Get ¶
func (h *MetricsHandler) Get(w http.ResponseWriter, r *http.Request)
func (*MetricsHandler) RegisterRoutes ¶
func (h *MetricsHandler) RegisterRoutes(router chi.Router)
type SummaryApiHandler ¶
type SummaryApiHandler struct {
// contains filtered or unexported fields
}
func NewSummaryApiHandler ¶
func NewSummaryApiHandler(userService services.IUserService, summaryService services.ISummaryService) *SummaryApiHandler
func (*SummaryApiHandler) Get ¶
func (h *SummaryApiHandler) Get(w http.ResponseWriter, r *http.Request)
@Summary Retrieve a summary @ID get-summary @Tags summary @Produce json @Param interval query string false "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 from query string false "Start date (e.g. '2021-02-07')" @Param to query string false "End date (e.g. '2021-02-08')" @Param recompute query bool false "Whether to recompute the summary from raw heartbeat or use cache" @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} models.Summary @Router /summary [get]
func (*SummaryApiHandler) RegisterRoutes ¶
func (h *SummaryApiHandler) RegisterRoutes(router chi.Router)