v1

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

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 AllTimeRange struct {
	End       string `json:"end"`
	EndDate   string `json:"end_date"`
	Start     string `json:"start"`
	StartDate string `json:"start_date"`
	Timezone  string `json:"timezone"`
}

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 JsonExportRange struct {
	Start int64 `json:"start"`
	End   int64 `json:"end"`
}

type JsonExportViewModel

type JsonExportViewModel struct {
	//User  *User            `json:"user"`
	Range *JsonExportRange `json:"range"`
	Days  []*JsonExportDay `json:"days"`
}

type LeadersCurrentUser

type LeadersCurrentUser struct {
	Rank int   `json:"rank"`
	Page int   `json:"page"`
	User *User `json:"user"`
}

type LeadersEntry

type LeadersEntry struct {
	Rank         int                  `json:"rank"`
	RunningTotal *LeadersRunningTotal `json:"running_total"`
	User         *User                `json:"user"`
}

type LeadersLanguage

type LeadersLanguage struct {
	Name         string  `json:"name"`
	TotalSeconds float64 `json:"total_seconds"`
}

type LeadersRange

type LeadersRange struct {
	EndText   string `json:"end_text"`
	EndDate   string `json:"end_date"`
	StartText string `json:"start_text"`
	StartDate string `json:"start_date"`
	Name      string `json:"name"`
	Text      string `json:"text"`
}

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 MachineEntry struct {
	Id    string `json:"id"`
	Value string `json:"value"`
}

type MachineViewModel

type MachineViewModel struct {
	Data       []*MachineEntry `json:"data"`
	TotalPages int             `json:"total_pages"`
}

type Project

type Project struct {
	ID                           string    `json:"id"`
	Name                         string    `json:"name"`
	LastHeartbeatAt              time.Time `json:"last_heartbeat_at"`
	HumanReadableLastHeartbeatAt string    `json:"human_readable_last_heartbeat_at"`
	UrlencodedName               string    `json:"urlencoded_name"`
	CreatedAt                    time.Time `json:"created_at"`
}

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 SummariesCumulativeTotal

type SummariesCumulativeTotal struct {
	Decimal string  `json:"decimal"`
	Digital string  `json:"digital"`
	Seconds float64 `json:"seconds"`
	Text    string  `json:"text"`
}

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 SummariesEntry struct {
	Digital      string  `json:"digital"`
	Hours        int     `json:"hours"`
	Minutes      int     `json:"minutes"`
	Name         string  `json:"name"`
	Percent      float64 `json:"percent"`
	Seconds      int     `json:"seconds"`
	Text         string  `json:"text"`
	TotalSeconds float64 `json:"total_seconds"`
}

type SummariesGrandTotal

type SummariesGrandTotal struct {
	Digital      string  `json:"digital"`
	Hours        int     `json:"hours"`
	Minutes      int     `json:"minutes"`
	Text         string  `json:"text"`
	TotalSeconds float64 `json:"total_seconds"`
}

type SummariesRange

type SummariesRange struct {
	Date     string    `json:"date"`
	End      time.Time `json:"end"`
	Start    time.Time `json:"start"`
	Text     string    `json:"text"`
	Timezone string    `json:"timezone"`
}

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

func NewFromUser(user *models.User) *User

func (*User) WithLatestHeartbeat

func (u *User) WithLatestHeartbeat(h *models.Heartbeat) *User

type UserAgentEntry

type UserAgentEntry struct {
	Id     string `json:"id"`
	Editor string `json:"editor"`
	Os     string `json:"os"`
	Value  string `json:"value"`
}

type UserAgentsViewModel

type UserAgentsViewModel struct {
	Data       []*UserAgentEntry `json:"data"`
	TotalPages int               `json:"total_pages"`
}

type UserViewModel

type UserViewModel struct {
	Data *User `json:"data"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL