37 Star 403 Fork 75

GVPrancher/rancher

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
github_account.go 1.02 KB
一键复制 编辑 原始数据 按行查看 历史
Craig Jellick 提交于 2018-03-06 14:49 . real search for github
package github
import (
"fmt"
)
type searchResult struct {
Items []Account `json:"items"`
}
//Account defines properties an account on github has
type Account struct {
ID int `json:"id,omitempty"`
Login string `json:"login,omitempty"`
Name string `json:"name,omitempty"`
AvatarURL string `json:"avatar_url,omitempty"`
HTMLURL string `json:"html_url,omitempty"`
Type string `json:"type,omitempty"`
}
//Team defines properties a team on github has
type Team struct {
ID int `json:"id,omitempty"`
Organization map[string]interface{} `json:"organization,omitempty"`
Name string `json:"name,omitempty"`
Slug string `json:"slug,omitempty"`
}
func (t *Team) toGithubAccount(url string, account *Account) {
account.ID = t.ID
account.Name = t.Name
orgLogin := (t.Organization["login"]).(string)
account.AvatarURL = t.Organization["avatar_url"].(string)
account.HTMLURL = fmt.Sprintf(url, orgLogin, t.Slug)
account.Login = t.Slug
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/rancher/rancher.git
git@gitee.com:rancher/rancher.git
rancher
rancher
rancher
v2.1.5

搜索帮助