Documentation ¶
Overview ¶
Package ghca provides functionalities of github-clone-all command. Because of restriction of GitHub search API, max number of results is 1000 repositories. And you may need to gain GitHub API token in advance to avoid reaching API rate limit.
Please see the repository page to know more detail.
https://github.com/rhysd/github-clone-all
Index ¶
Constants ¶
const PageUnlimited uint = 0
PageUnlimited means to fetch and clone repositories as much as possible.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CLI ¶
type CLI struct {
// contains filtered or unexported fields
}
CLI represents a command line interface of github-clone-all.
type Cloner ¶
type Cloner struct { // Err is a receiver of errors which occurs while cloning repositories Err chan error // SSH is a flag to use SSH for git-clone. By default, it's false and HTTPS is used. SSH bool // contains filtered or unexported fields }
Cloner is a git-clone worker to clone given repositories with workers in parallel.
type Collector ¶
type Collector struct { // Query is a query to search repositories on GitHub. // Please refer following links to know about query: // https://help.github.com/articles/understanding-the-search-syntax/ // https://help.github.com/articles/searching-repositories/ Query string // Dest is a directory to clone repository into. Dest string // Extract is a regular expression to extract files with. It can be nil. Extract *regexp.Regexp // Count represents max number of repositories to clone Count int // Dry indicates doing dry-run instead of cloning repositories Dry bool // Deep indicates shallow clone is not used Deep bool // contains filtered or unexported fields }
Collector is a worker to fetch repositories via GitHub Search API and clone them all. You should NOT reuse Collector instance for multiple queries.
func NewCollector ¶
func NewCollector(query, token, dest string, extract *regexp.Regexp, count int, dry bool, deep bool, page *PageConfig) *Collector
NewCollector creates Collector instance.
type PageConfig ¶
type PageConfig struct { // Per represents how many repositories per sending request. Per uint // Max represents a max page. Max uint // Start represents which page should be started. Start uint }
PageConfig represents configurations for pagination of the Search API.