Documentation
¶
Overview ¶
Package github talks to the GitHub API: repository discovery, size estimates for the disk budget and the activity feed that names commits a clone can no longer see.
Index ¶
- func Token() string
- type Client
- func (c *Client) Authenticated() bool
- func (c *Client) Contributors(ctx context.Context, owner, name string, limit int) ([]string, error)
- func (c *Client) ListRepos(ctx context.Context, owner string, opts ListOptions) ([]Repo, error)
- func (c *Client) Repo(ctx context.Context, owner, name string) (Repo, error)
- func (c *Client) Rewrites(ctx context.Context, owner, name string, maxPages int) ([]Rewrite, error)
- type ListOptions
- type Repo
- type Rewrite
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps the go-github client with the calls patty needs.
func NewClientWithBaseURL ¶
NewClientWithBaseURL is for tests against a fake API.
func (*Client) Authenticated ¶ added in v0.13.0
Authenticated reports whether the client carries a token. Anonymous access is limited to sixty requests an hour, so optional lookups are skipped without one.
func (*Client) Contributors ¶ added in v0.13.0
Contributors lists the logins of the repository's contributors, most commits first, at most limit of them. Anonymous contributors, which the API lists without a login, are left out.
func (*Client) ListRepos ¶
ListRepos lists the repositories of a user or organization. For the authenticated user this includes private repositories.
type ListOptions ¶
ListOptions filters ListRepos.
type Repo ¶
type Repo struct {
Owner string
Name string
SizeKB int
Fork bool
Archived bool
Private bool
Empty bool
}
Repo is what patty needs to know about a repository before cloning it.
type Rewrite ¶
type Rewrite struct {
Before string `json:"before"`
After string `json:"after,omitempty"`
Ref string `json:"ref"`
Type string `json:"type"`
Actor string `json:"actor,omitempty"`
Timestamp time.Time `json:"timestamp"`
}
Rewrite is a ref update that made commits unreachable on the server: a force push replaced Before with After, or a branch deletion removed Before.