Documentation
¶
Index ¶
- Variables
- type APIError
- type Client
- func (c *Client) Domain() string
- func (c *Client) GetRepo(ctx context.Context, owner, name string) (*Repo, error)
- func (c *Client) ListOrgRepos(ctx context.Context, org string) ([]Repo, error)
- func (c *Client) ListPersonalRepos(ctx context.Context) ([]Repo, error)
- func (c *Client) ListUserOrgs(ctx context.Context) ([]Org, error)
- type Org
- type Repo
- type RepoOwner
Constants ¶
This section is empty.
Variables ¶
var ErrRepoNotFound = errors.New("repository not found")
ErrRepoNotFound signals that a repository does not exist on this domain, or that the token cannot see it. GitHub returns 404 for both, and to a caller probing several domains they mean the same thing: try the next one.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides authenticated access to the GitHub REST API. Supports both github.com and GitHub Enterprise domains.
func NewClient ¶
NewClient creates an authenticated GitHub API client for the given domain. For github.com, uses https://api.github.com. For GHE domains, uses https://<domain>/api/v3.
func (*Client) GetRepo ¶ added in v1.5.1
GetRepo looks up a single repository by owner and name. Unlike the list endpoints, this works for repos the user neither owns nor collaborates on, which is what makes it useful as a cache-miss fallback.
func (*Client) ListOrgRepos ¶
ListOrgRepos returns all repositories for the given organization.
func (*Client) ListPersonalRepos ¶
ListPersonalRepos returns repositories owned by the authenticated user.