Documentation ¶
Index ¶
- func BuildRepoUrl(user, repo string) string
- func DownloadRepo(user, repo, saveDir string, proxy string, timeout time.Duration) error
- func ParseUrl(githubUrl string) (user, repo, sub string, err error)
- type API
- type Client
- type GitDrive
- type GitPartition
- type RateLimit
- type Release
- type ReleaseAsset
- type RepoInfo
- type RepoInfoList
- type Spider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildRepoUrl ¶
func DownloadRepo ¶
Download repository as zip file, and unzip it to specify save directory
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func (*API) GetAllReposInfo ¶
func (c *API) GetAllReposInfo(user string) (*RepoInfoList, error)
func (*API) GetRateLimit ¶
func (*API) GetRepoBasicInfoWithUrl ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) DownloadRepoFile ¶
example filepath: cartman/cartman-repo/reports/coin-tags.csv user: cartman repo: cartman-repo filepath: reports/tags.csv
filepath is different with public repo files' raw access url like: https://github.com/cartman/cartman-repo/raw/master/reports/tags.csv
func (*Client) GetAllReposInfo ¶
func (c *Client) GetAllReposInfo(user string) (*RepoInfoList, error)
func (*Client) GetRateLimit ¶
type GitDrive ¶
type GitDrive struct {
// contains filtered or unexported fields
}
func NewGitDrive ¶
func (*GitDrive) CreatePartition ¶
func (*GitDrive) Partition ¶
func (gd *GitDrive) Partition(name string) *GitPartition
func (*GitDrive) Partitions ¶
type GitPartition ¶
type GitPartition struct {
// contains filtered or unexported fields
}
func (*GitPartition) LastUpdateTime ¶
func (gp *GitPartition) LastUpdateTime() (time.Time, error)
func (*GitPartition) ReadAsZip ¶
func (gp *GitPartition) ReadAsZip() ([]byte, error)
Download repository as zip file, and unzip it to specify save directory
type Release ¶
type Release struct { Version string DescTitle string DescContent string PublishedTime time.Time Assets []ReleaseAsset }
func GetLatestRelease ¶
func (*Release) ParseCurrentPlatform ¶
func (r *Release) ParseCurrentPlatform() (*ReleaseAsset, error)
根据文件名尝试分析当前平台对应的条目。 主要就是分析文件名中的"windows"/"darwin"/"linux","i386"/"arm64"/"amd64"等字样
type ReleaseAsset ¶
type RepoInfoList ¶
type RepoInfoList struct {
Items []RepoInfo
}
func (*RepoInfoList) MainRepo ¶
func (rs *RepoInfoList) MainRepo() (*RepoInfo, error)
type Spider ¶
type Spider struct {
// contains filtered or unexported fields
}
func (*Spider) GetAllReposInfo ¶
func (s *Spider) GetAllReposInfo(user string) (*RepoInfoList, error)
func (*Spider) GetRateLimit ¶
Click to show internal directories.
Click to hide internal directories.