diff --git a/github_api.go b/github_api.go index ebabe57..7438272 100644 --- a/github_api.go +++ b/github_api.go @@ -14,9 +14,9 @@ import ( ) type GitHubAPI struct { + httpc *http.Client user string token string - httpc *http.Client } func NewGitHubAPI() *GitHubAPI { diff --git a/handler.go b/handler.go index f8f5acb..3061e85 100644 --- a/handler.go +++ b/handler.go @@ -56,13 +56,13 @@ func commitLogHandler(db *gorm.DB) echo.HandlerFunc { func statsHandler(db *gorm.DB) echo.HandlerFunc { type DailyStatsResults struct { - Count int64 Date time.Time + Count int64 } type CachedStats struct { - TotalCommits int64 DailyStats []*DailyStatsResults + TotalCommits int64 } var statsCache *CachedStats diff --git a/model.go b/model.go index 5eaddad..71ea525 100644 --- a/model.go +++ b/model.go @@ -12,9 +12,9 @@ import ( // // https://docs.github.com/en/free-pro-team@latest/rest/reference/search#search-commits type SearchResults struct { + Items []SearchResultItem `json:"items"` TotalCount int `json:"total_count"` IncompleteResults bool `json:"incomplete_results"` - Items []SearchResultItem `json:"items"` } // SearchResultItem represents an individual item in the search results for the Github search commits API