feat: split project name into owner and name
This commit is contained in:
parent
26ed84f50b
commit
45816ac7a8
2 changed files with 7 additions and 1 deletions
|
|
@ -1,6 +1,10 @@
|
||||||
package model
|
package model
|
||||||
|
|
||||||
type GitHubAPI struct {
|
type GitHubAPI struct {
|
||||||
|
Owner struct {
|
||||||
|
Login string `json:"login"`
|
||||||
|
} `json:"owner"`
|
||||||
|
Name string `json:"name"`
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
Stars int `json:"stargazers_count"`
|
Stars int `json:"stargazers_count"`
|
||||||
Language string `json:"language"`
|
Language string `json:"language"`
|
||||||
|
|
@ -8,6 +12,7 @@ type GitHubAPI struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type GitHubData struct {
|
type GitHubData struct {
|
||||||
|
Owner string `json:"owner"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
Stars int `json:"stars"`
|
Stars int `json:"stars"`
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,8 @@ func GetGitHubData() []model.GitHubData {
|
||||||
}
|
}
|
||||||
|
|
||||||
data = append(data, model.GitHubData{
|
data = append(data, model.GitHubData{
|
||||||
Name: project,
|
Owner: apiResponse.Owner.Login,
|
||||||
|
Name: apiResponse.Name,
|
||||||
Description: apiResponse.Description,
|
Description: apiResponse.Description,
|
||||||
Stars: apiResponse.Stars,
|
Stars: apiResponse.Stars,
|
||||||
Language: apiResponse.Language,
|
Language: apiResponse.Language,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue