{"modulePath":"github.com/cryptowilliam/gozilla","version":"v0.0.0-20211025133012-047dcd9433d4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package github\n\n## Functions\n\n```go\nfunc BuildRepoUrl(user, repo string) string\n```\n\n```go\nfunc DownloadRepo(user, repo, saveDir string, proxy string, timeout time.Duration) error\n```\nDownload repository as zip file, and unzip it to specify save directory\n\n```go\nfunc ParseUrl(githubUrl string) (user, repo, sub string, err error)\n```\nsupport github.com/\\*\\*\\*, www.github.com/\\*\\*\\*, gist.github.com/\\*\\*\\*\n\n## Types\n\n```go\ntype API struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (c *API) GetAllReposInfo(user string) (*RepoInfoList, error)\n```\n\n```go\nfunc (c *API) GetRateLimit() (RateLimit, error)\n```\n\n```go\nfunc (c *API) GetRepoBasicInfoWithUrl(repoUrl string) (*RepoInfo, error)\n```\n\n```go\nfunc (c *API) GetRepoInfo(user, repo string) (*RepoInfo, error)\n```\n\n```go\ntype Client struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewGithub(token, proxy string) (*Client, error)\n```\n\n```go\nfunc (c *Client) DownloadRepoFile(filepath string) ([]byte, error)\n```\nexample filepath: cartman/cartman-repo/reports/coin-tags.csv user: cartman repo: cartman-repo filepath: reports/tags.csv\n\nfilepath is different with public repo files' raw access url like: [https://github.com/cartman/cartman-repo/raw/master/reports/tags.csv](https://github.com/cartman/cartman-repo/raw/master/reports/tags.csv)\n\n```go\nfunc (c *Client) GetAllReposInfo(user string) (*RepoInfoList, error)\n```\n\n```go\nfunc (c *Client) GetRateLimit() (RateLimit, error)\n```\n\n```go\ntype GitDrive struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewGitDrive(token, proxy string) (*GitDrive, error)\n```\n\n```go\nfunc (gd *GitDrive) CreatePartition(name string) error\n```\n\n```go\nfunc (gd *GitDrive) MyName() (string, error)\n```\n\n```go\nfunc (gd *GitDrive) Partition(name string) *GitPartition\n```\n\n```go\nfunc (gd *GitDrive) Partitions() ([]string, error)\n```\n\n```go\ntype GitPartition struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (gp *GitPartition) LastUpdateTime() (time.Time, error)\n```\n\n```go\nfunc (gp *GitPartition) ReadAsZip() ([]byte, error)\n```\nDownload repository as zip file, and unzip it to specify save directory\n\n```go\nfunc (gp *GitPartition) ReadFile(file string) ([]byte, error)\n```\n\n```go\nfunc (gp *GitPartition) WriteFile(file string, data []byte) error\n```\n\n```go\ntype RateLimit struct {\n\tCoreReqPerHour, SearchReqPerHour int\n\tCoreInterval, SearchInterval     time.Duration\n}\n```\n\n```go\ntype Release struct {\n\tVersion       string\n\tDescTitle     string\n\tDescContent   string\n\tPublishedTime time.Time\n\tAssets        []ReleaseAsset\n}\n```\n\n```go\nfunc GetLatestRelease(user, repo string) (*Release, error)\n```\n\n```go\nfunc (r *Release) ParseCurrentPlatform() (*ReleaseAsset, error)\n```\n根据文件名尝试分析当前平台对应的条目。 主要就是分析文件名中的\"windows\"/\"darwin\"/\"linux\",\"i386\"/\"arm64\"/\"amd64\"等字样\n\n```go\ntype ReleaseAsset struct {\n\tName        string\n\tByteSize    int\n\tDownloadUrl string\n}\n```\n\n```go\ntype RepoInfo struct {\n\tName               string\n\tCreateTime         time.Time\n\tRepoLastUpdateTime time.Time // Repository last updated time, include issue/wiki....\n\tCodeLastPushedTime time.Time // Source code last pushed time.\n\tStarsCount         int\n\tForkCount          int\n\tLanguage           string\n}\n```\n\n```go\ntype RepoInfoList struct {\n\tItems []RepoInfo\n}\n```\n\n```go\nfunc (rs *RepoInfoList) MainRepo() (*RepoInfo, error)\n```\n\n```go\ntype Spider struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewSpider(proxy string) (*Spider, error)\n```\n\n```go\nfunc (s *Spider) GetAllReposInfo(user string) (*RepoInfoList, error)\n```\n\n```go\nfunc (s *Spider) GetRateLimit() (RateLimit, error)\n```\n\n","path":"github.com/cryptowilliam/gozilla/webapi/github","name":"github","synopsis":"","isRedistributable":true}
