Documentation
¶
Index ¶
- Constants
- type AllTimeData
- type AllTimeRange
- type AllTimeViewModel
- type DataDumpData
- type DataDumpResultErrorModel
- type DataDumpResultViewModel
- type DataDumpViewModel
- type HeartbeatEntry
- type HeartbeatsViewModel
- type JsonExportDay
- type JsonExportRange
- type JsonExportViewModel
- type LeadersCurrentUser
- type LeadersEntry
- type LeadersLanguage
- type LeadersRange
- type LeadersRunningTotal
- type LeadersViewModel
- type MachineEntry
- type MachineViewModel
- type Project
- type ProjectViewModel
- type ProjectsViewModel
- type StatsData
- type StatsViewModel
- type SummariesCumulativeTotal
- type SummariesDailyAverage
- type SummariesData
- type SummariesEntry
- type SummariesGrandTotal
- type SummariesRange
- type SummariesViewModel
- type User
- type UserAgentEntry
- type UserAgentsViewModel
- type UserViewModel
Constants ¶
View Source
const DefaultWakaUserDisplayName = "Anonymous User"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllTimeData ¶
type AllTimeData struct {
TotalSeconds float32 `json:"total_seconds"` // total number of seconds logged since account created
Text string `json:"text"` // total time logged since account created as human readable string>
IsUpToDate bool `json:"is_up_to_date"` // true if the stats are up to date; when false, a 202 response code is returned and stats will be refreshed soon>
Range *AllTimeRange `json:"range"`
}
type AllTimeRange ¶
type AllTimeViewModel ¶
type AllTimeViewModel struct {
Data *AllTimeData `json:"data"`
}
func NewAllTimeFrom ¶
func NewAllTimeFrom(summary *models.Summary) *AllTimeViewModel
type DataDumpData ¶
type DataDumpData struct {
Id string `json:"id"`
Type string `json:"type"`
DownloadUrl string `json:"download_url"`
Status string `json:"status"`
PercentComplete float32 `json:"percent_complete"`
Expires string `json:"expires"`
CreatedAt string `json:"created_at"`
HasFailed bool `json:"has_failed"`
IsStuck bool `json:"is_stuck"`
IsProcessing bool `json:"is_processing"`
}
type DataDumpResultErrorModel ¶
type DataDumpResultErrorModel struct {
Error string `json:"error"`
}
type DataDumpResultViewModel ¶
type DataDumpResultViewModel struct {
Data *DataDumpData `json:"data"`
}
type DataDumpViewModel ¶
type DataDumpViewModel struct {
Data []*DataDumpData `json:"data"`
Total int `json:"total"`
TotalPages int `json:"total_pages"`
}
type HeartbeatEntry ¶
type HeartbeatEntry struct {
Id string `json:"id"`
Branch string `json:"branch"`
Category string `json:"category"`
Entity string `json:"entity"`
IsWrite bool `json:"is_write"`
Language string `json:"language"`
Project string `json:"project"`
Time float64 `json:"time"`
Type string `json:"type"`
UserId string `json:"user_id"`
MachineNameId string `json:"machine_name_id"`
UserAgentId string `json:"user_agent_id"`
CreatedAt time.Time `json:"created_at"`
}
func HeartbeatsToCompat ¶
func HeartbeatsToCompat(entries []*models.Heartbeat) []*HeartbeatEntry
type HeartbeatsViewModel ¶
type HeartbeatsViewModel struct {
Data []*HeartbeatEntry `json:"data"`
}
type JsonExportDay ¶
type JsonExportDay struct {
Date string `json:"date"`
Heartbeats []*HeartbeatEntry `json:"heartbeats"`
}
type JsonExportRange ¶
type JsonExportViewModel ¶
type JsonExportViewModel struct {
//User *User `json:"user"`
Range *JsonExportRange `json:"range"`
Days []*JsonExportDay `json:"days"`
}
type LeadersCurrentUser ¶
type LeadersEntry ¶
type LeadersEntry struct {
Rank int `json:"rank"`
RunningTotal *LeadersRunningTotal `json:"running_total"`
User *User `json:"user"`
}
type LeadersLanguage ¶
type LeadersRange ¶
type LeadersRunningTotal ¶
type LeadersRunningTotal struct {
TotalSeconds float64 `json:"total_seconds"`
HumanReadableTotal string `json:"human_readable_total"`
DailyAverage float64 `json:"daily_average"`
HumanReadableDailyAverage string `json:"human_readable_daily_average"`
Languages []*LeadersLanguage `json:"languages"`
}
type LeadersViewModel ¶
type LeadersViewModel struct {
CurrentUser *LeadersCurrentUser `json:"current_user"`
Data []*LeadersEntry `json:"data"`
Page int `json:"page"`
TotalPages int `json:"total_pages"`
Language string `json:"language"`
Range *LeadersRange `json:"range"`
}
type MachineEntry ¶
type MachineViewModel ¶
type MachineViewModel struct {
Data []*MachineEntry `json:"data"`
TotalPages int `json:"total_pages"`
}
type ProjectViewModel ¶
type ProjectViewModel struct {
Data *Project `json:"data"`
}
type ProjectsViewModel ¶
type ProjectsViewModel struct {
Data []*Project `json:"data"`
}
type StatsData ¶
type StatsData struct {
Username string `json:"username"`
UserId string `json:"user_id"`
Start time.Time `json:"start"`
End time.Time `json:"end"`
Status string `json:"status"`
TotalSeconds float64 `json:"total_seconds"`
DailyAverage float64 `json:"daily_average"`
DaysIncludingHolidays int `json:"days_including_holidays"`
Range string `json:"range"`
HumanReadableRange string `json:"human_readable_range"`
HumanReadableTotal string `json:"human_readable_total"`
HumanReadableDailyAverage string `json:"human_readable_daily_average"`
IsCodingActivityVisible bool `json:"is_coding_activity_visible"`
IsOtherUsageVisible bool `json:"is_other_usage_visible"`
Editors []*SummariesEntry `json:"editors"`
Languages []*SummariesEntry `json:"languages"`
Machines []*SummariesEntry `json:"machines"`
Projects []*SummariesEntry `json:"projects"`
OperatingSystems []*SummariesEntry `json:"operating_systems"`
Branches []*SummariesEntry `json:"branches,omitempty"`
Categories []*SummariesEntry `json:"categories"`
}
type StatsViewModel ¶
type StatsViewModel struct {
Data *StatsData `json:"data"`
}
func NewStatsFrom ¶
func NewStatsFrom(summary *models.Summary, filters *models.Filters) *StatsViewModel
type SummariesDailyAverage ¶
type SummariesDailyAverage struct {
DaysIncludingHolidays int `json:"days_including_holidays"`
DaysMinusHolidays int `json:"days_minus_holidays"`
Holidays int `json:"holidays"`
Seconds int64 `json:"seconds"`
SecondsIncludingOtherLanguage int64 `json:"seconds_including_other_language"`
Text string `json:"text"`
TextIncludingOtherLanguage string `json:"text_including_other_language"`
}
type SummariesData ¶
type SummariesData struct {
Categories []*SummariesEntry `json:"categories"`
Dependencies []*SummariesEntry `json:"dependencies"`
Editors []*SummariesEntry `json:"editors"`
Languages []*SummariesEntry `json:"languages"`
Machines []*SummariesEntry `json:"machines"`
OperatingSystems []*SummariesEntry `json:"operating_systems"`
Projects []*SummariesEntry `json:"projects"`
Branches []*SummariesEntry `json:"branches"`
Entities []*SummariesEntry `json:"entities"`
GrandTotal *SummariesGrandTotal `json:"grand_total"`
Range *SummariesRange `json:"range"`
}
func (*SummariesData) MarshalJSON ¶
func (s *SummariesData) MarshalJSON() ([]byte, error)
MarshalJSON adds a customized JSON serialization that will include the `branches` and `entities` fields if set to empty arrays, but exclude them if otherwise considered empty.
type SummariesEntry ¶
type SummariesGrandTotal ¶
type SummariesRange ¶
type SummariesViewModel ¶
type SummariesViewModel struct {
Data []*SummariesData `json:"data"`
End time.Time `json:"end"`
Start time.Time `json:"start"`
CumulativeTotal *SummariesCumulativeTotal `json:"cumulative_total"`
DailyAverage *SummariesDailyAverage `json:"daily_average"`
}
func NewSummariesFrom ¶
func NewSummariesFrom(summaries []*models.Summary) *SummariesViewModel
type User ¶
type User struct {
ID string `json:"id"`
DisplayName string `json:"display_name"`
FullName string `json:"full_name"`
Email string `json:"email"`
IsEmailPublic bool `json:"is_email_public"`
IsEmailConfirmed bool `json:"is_email_confirmed"`
TimeZone string `json:"timezone"`
LastHeartbeatAt models.CustomTime `json:"last_heartbeat_at"`
LastProject string `json:"last_project"`
LastPluginName string `json:"last_plugin_name"`
Username string `json:"username"`
Website string `json:"website"`
CreatedAt models.CustomTime `json:"created_at"`
ModifiedAt models.CustomTime `json:"modified_at"`
Photo string `json:"photo"`
}
func NewFromUser ¶
type UserAgentEntry ¶
type UserAgentsViewModel ¶
type UserAgentsViewModel struct {
Data []*UserAgentEntry `json:"data"`
TotalPages int `json:"total_pages"`
}
type UserViewModel ¶
type UserViewModel struct {
Data *User `json:"data"`
}
Click to show internal directories.
Click to hide internal directories.