{"modulePath":"github.com/robpol86/githubbackup","version":"v0.0.0-20161225195130-3ff763cd75c6","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package api\n\n## Types\n\n```go\ntype API struct {\n\tNoComments bool\n\tNoForks    bool\n\tNoIssues   bool\n\tNoPrivate  bool\n\tNoPublic   bool\n\tNoReleases bool\n\tNoWikis    bool\n\tToken      string\n\tUser       string\n\n\tTestURL string\n\n\tgithub.Rate\n}\n```\nAPI holds fields and functions related to querying the GitHub API.\n\n```go\nfunc NewAPI(config config.Config, testTokenAnswer string) (api API, err error)\n```\nNewAPI reads config data and conditionally prompts for the API token (as a password prompt).\n\nAlways prompt for token if not specified. There are higher API limits for authenticated users.\n\n:param config: Config struct value with options from the CLI.\n\n:param testTokenAnswer: For testing. Don't prompt for token, use this value instead.\n\n```go\nfunc (a *API) Fields() logrus.Fields\n```\nFields is for logging. Returns the field name and values of the API struct as a logrus.Fields value.\n\n```go\nfunc (a *API) GetGists(ghGists *GitHubGists) error\n```\nGetGists retrieves the list of public and secret GitHub gists on the user's account.\n\n:param ghGists: Add gists to this.\n\n```go\nfunc (a *API) GetRepos(ghRepos *GitHubRepos) error\n```\nGetRepos retrieves the list of public and private GitHub repos on the user's account.\n\n:param ghRepos: Add repos to this.\n\n```go\ntype GitHubGist struct {\n\tName        string\n\tSize        int\n\tPrivate     bool\n\tPushedAt    time.Time\n\tCloneURL    string\n\tHasComments bool\n}\n```\nGitHubGist holds data for one GitHub Gist.\n\n```go\ntype GitHubGists []GitHubGist\n```\nGitHubGists is a slice of GitHubGist with attached convenience function receivers.\n\n```go\nfunc (g *GitHubGists) Counts() map[string]int\n```\nCounts returns the number of gists (values) for specific types/categories (keys).\n\n```go\ntype GitHubRepo struct {\n\tName      string\n\tSize      int\n\tFork      bool\n\tPrivate   bool\n\tPushedAt  time.Time\n\tCloneURL  string\n\tWikiURL   string\n\tHasIssues bool\n}\n```\nGitHubRepo holds data for one GitHub repository.\n\n```go\ntype GitHubRepos []GitHubRepo\n```\nGitHubRepos is a slice of GitHubRepo with attached convenience function receivers.\n\n```go\nfunc (g *GitHubRepos) Counts() map[string]int\n```\nCounts returns the number of repos (values) for specific types/categories (keys).\n\n","path":"github.com/robpol86/githubbackup/api","name":"api","synopsis":"","isRedistributable":true}
