github.com/crosbymichael/octokat@v0.0.0-20160826194511-076a32289ed5/README.md (about)

     1  # Octokat [![Build Status](https://travis-ci.org/jingweno/octokat.png?branch=master)](https://travis-ci.org/jingweno/octokat)
     2  
     3  Simple Go wrapper for the GitHub API. It's extracted from [my other project](https://github.com/jingweno/gh). The API is inspired by [octokit.rb](https://github.com/octokit/octokit.rb).
     4  
     5  # GoDoc
     6  
     7  [https://godoc.org/github.com/crosbymichael/octokat](https://godoc.org/github.com/crosbymichael/octokat)
     8  
     9  # Example
    10  
    11  ## Show a user
    12  
    13  ```go
    14  package main
    15  
    16  import "github.com/crosbymichael/octokat"
    17  
    18  func main() {
    19      client := octokat.NewClient()
    20      user, err := client.User("jingweno", nil)
    21      // Do something with user
    22  }
    23  ```
    24  
    25  ## List authorizations
    26  
    27  ```go
    28  package main
    29  
    30  import "github.com/crosbymichael/octokat"
    31  
    32  func main() {
    33      client := octokat.NewClient().WithLogin("LOGIN", "PASSWORD")
    34      authorizations, err := client.Authorizations(nil)
    35      // Do something with authorizations
    36  }
    37  ```
    38  
    39  ## Create a pull request
    40  
    41  ```go
    42  package main
    43  
    44  import "github.com/crosbymichael/octokat"
    45  
    46  func main() {
    47      client := octokat.NewClient().WithToken("OAUTH_TOKEN")
    48      repo := octokat.Repo{Name: "octokat", UserName: "jingweno"}
    49      params := octokat.PullRequestParams{Base: "master", Head: "feature", Title: "A pull request", Body: "A body"}
    50      options := octokat.Options{Params: params}
    51      pullRequest, err := client.CreatePullRequest(repo, &options)
    52      // Do something with pullRequest
    53  }
    54  ```
    55  
    56  ## Release Notes
    57  
    58  See [Releases](https://github.com/jingweno/octokat/releases).
    59  
    60  ## Contributing
    61  
    62  1. Fork it
    63  2. Create your feature branch (`git checkout -b my-new-feature`)
    64  3. Commit your changes (`git commit -am 'Add some feature'`)
    65  4. Push to the branch (`git push origin my-new-feature`)
    66  5. Create new Pull Request
    67  
    68  ## License
    69  
    70  octokat is released under the MIT license. See
    71  [LICENSE.md](https://github.com/jingweno/octokat/blob/master/LICENSE.md).