Browse Source

move package docs to doc.go

our package docs are too long yet to really need to be in their own
file, but I'd like to flesh them out a bit more, particularly once #19
is resolved.
Will Norris 13 years ago
parent
commit
f4dde7d729
2 changed files with 45 additions and 39 deletions
  1. +45
    -0
      github/doc.go
  2. +0
    -39
      github/github.go

+ 45
- 0
github/doc.go View File

@ -0,0 +1,45 @@
// Copyright 2013 The go-github AUTHORS. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
/*
Package github provides a client for using the GitHub API.
Access different parts of the GitHub API using the various services on a GitHub
Client:
client := github.NewClient(nil)
// list all organizations for user "willnorris"
orgs, _, err := client.Organizations.List("willnorris", nil)
Set optional parameters for an API method by passing an Options object.
// list recently updated repositories for org "github"
opt := &github.RepositoryListByOrgOptions{Sort: "updated"}
repos, _, err := client.Repositories.ListByOrg("github", opt)
Make authenticated API calls by constructing a GitHub client using an OAuth
capable http.Client:
import "code.google.com/p/goauth2/oauth"
// simple OAuth transport if you already have an access token;
// see goauth2 library for full usage
t := &oauth.Transport{
Token: &oauth.Token{AccessToken: "..."},
}
client := github.NewClient(t.Client())
// list all repositories for the authenticated user
repos, _, err := client.Repositories.List(nil)
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.
The full GitHub API is documented at http://developer.github.com/v3/.
*/
package github

+ 0
- 39
github/github.go View File

@ -3,45 +3,6 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
/*
Package github provides a client for using the GitHub API.
Access different parts of the GitHub API using the various services on a GitHub
Client:
client := github.NewClient(nil)
// list all organizations for user "willnorris"
orgs, err := client.Organizations.List("willnorris", nil)
Set optional parameters for an API method by passing an Options object.
// list recently updated repositories for org "github"
opt := &github.RepositoryListByOrgOptions{Sort: "updated"}
repos, err := client.Repositories.ListByOrg("github", opt)
Make authenticated API calls by constructing a GitHub client using an OAuth
capable http.Client:
import "code.google.com/p/goauth2/oauth"
// simple OAuth transport if you already have an access token;
// see goauth2 library for full usage
t := &oauth.Transport{
Token: &oauth.Token{AccessToken: "..."},
}
client := github.NewClient(t.Client())
// list all repositories for the authenticated user
repos, err := client.Repositories.List(nil)
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.
The full GitHub API is documented at http://developer.github.com/v3/.
*/
package github package github
import ( import (


Loading…
Cancel
Save