go-github-client

module
v0.0.0-...-c4bda31 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2012 License: BSD-3-Clause

README

go-github-client: Github v3 API Client for Go

Description

go-github-client is a Go package that aims to smoothly integrate Github Rest API in Go applications.

WARNING: This software is alpha quality so use it at your risks ;-)

We've extracted and refactored this package from cocode.io, our real-time web collaborative code editor integrated with GitHub Gist. The package is currently under active development because we're enhancing the integration between cocode.io and GitHub.

To keep you updated about future development, please feel free to watch this project on GitHub and to follow us on:

Of course, we're looking forward for your feedback & patches :)

Quickstart Examples

go get & go install

Download go-gothub-client and install go-github-client/client:

$ go get github.com/sbinet/go-github-client/client

This command clone all the repository in "$GOPATH/src/github.com/sbinet/go-github-client" and install "github.com/sbinet/go-github-client/client" package in "$GOPATH/pkg/ARCH/github.com/sbinet/go-github-client/client.a"

Now you can "go install" all the other subpackage (or just what you want):

$ go install github.com/sbinet/go-github-client/users

$ go install github.com/sbinet/go-github-client/gists

$ go install github.com/sbinet/go-github-client/issues
go-github-client command line example applications

You can build and install some example applications using "go install":

$ go install github.com/sbinet/go-github-client/examples/gh_get_userinfo

$ $GOPATH/bin/gh_get_userinfo
...
Create an authenticated GitHub API Client using Basic Authentication method
import (
  ghclient "github.com/sbinet/go-github-client/client"
)

...

ghc, _ := ghclient.NewGitHubClient("testuser", "password", AUTH_USER_PASSWORD)

Get information about the authenticated user
import (
  ghusers "github.com/sbinet/go-github-client/users"
)

usersc = ghusers.NewUsers(ghc)
res, err := usersc.GetUserInfo(*userinfo)
jr, err := res.Json()
name := jr.GetString("login")

Paginate public gists
import (
  ghgist "github.com/sbinet/go-github-client/gists"
)

gistsc = ghgists.NewUsers(ghc)
res, err := gistsc.GetPublicGists()
jr, err := res.Json()

res2, err := res.NextPage()
jr2, err := res.Json()

More Info

API Reference
Examples

Directories

Path Synopsis
Package "client" implements a generic github api client.
Package "client" implements a generic github api client.
examples
Package "gists" implements a gists github api client.
Package "gists" implements a gists github api client.
Package "issues" implements a issues github api client.
Package "issues" implements a issues github api client.
Package "users" implements a users github api client.
Package "users" implements a users github api client.

Jump to

Keyboard shortcuts

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