github

package
v0.0.0-...-5eb8025 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client knows how to call the GitHub API to get contributor information.

func NewClient

func NewClient(token string) (*Client, error)

NewClient builds a Client value. It validates that the token field is set and is not blank. It sets internal state for the http client. Call it like:

github.NewClient(os.Getenv("GITHUB_TOKEN"))

func (*Client) Contributors

func (c *Client) Contributors(repo string) ([]Contributor, error)

Contributors gives a list of the top 30 contributors. It returns an error for network problems reaching the API or for application problems such as a 404 or 403 response from GitHub.

type Contributor

type Contributor struct {
	Login         string `json:"login"`
	Contributions int    `json:"contributions"`
}

Contributor summarizes one person's contributions to a particular GitHub repository.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL