pip compatible server to serve Python packages out of GitHub
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Will Norris c9d2c133aa fill out readme and other docs a bit more 13 years ago
examples fill out readme and other docs a bit more 13 years ago
CONTRIBUTING.md fill out readme and other docs a bit more 13 years ago
LICENSE add readme, license, and contributing files 13 years ago
README.md fill out readme and other docs a bit more 13 years ago
github.go fill out readme and other docs a bit more 13 years ago
github_test.go initial checkin of go-github code 13 years ago
orgs.go initial checkin of go-github code 13 years ago
orgs_test.go initial checkin of go-github code 13 years ago
repos.go initial checkin of go-github code 13 years ago
repos_test.go initial checkin of go-github code 13 years ago
users.go initial checkin of go-github code 13 years ago

README.md

go-github

go-github is Go library for accessing the GitHub API.

Documentation: http://godoc.org/github.com/google/go-github

Usage

Construct a new GitHub client, then use the various services on the client to access different parts of the GitHub API. For example, list all organizations for user "willnorris":

client := github.NewClient(nil)
orgs, err := client.Organizations.List("willnorris", nil)

Some API methods have optional parameters than can be passed. For example, list recently updated repositories for org "github":

client := github.NewClient(nil)
opt := &github.RepositoryListByOrgOptions{Sort: "updated"}
repos, err := client.Repositories.ListByOrg("github", opt)

The go-github library does not directly handle authentication. Instead, when creating a new client, pass an http.Client than can handle authentication for you. The easiest, and recommended, way to do this is using the goauth2 library, but you can of course use any other library that provides an http.Client. For example, to use the goauth2 library with an existing OAuth access token:

t := &oauth.Transport{
  Config: &oauth.Config{},
  Token: &oauth.Token{AccessToken: "..."}
}

client := github.NewClient(t.Client())

// list all repositories for the authenticated user
repos, err := client.Repositories.List(nil)

See the goauth2 docs for complete instructions on using that library.

Also note that when using an authenticated Client, all calls made by the client will include the specified OAuth token. Therefore, authenticated clients should almost never be shared between different users.

Roadmap

This library is being initially developed for an internal application at Google, so API methods will likely be implemented in the order that they are needed by that application. You can track the status of implementation in [this Google spreadsheet][]. Eventually, I would like to cover the entire GitHub API, so contributions are of course always welcome. The calling pattern is pretty well established, so adding new methods is relatively straightforward.

License

This library is distributed under the BSD-style license found in the LICENSE file.