Skip to content

Commit

Permalink
Get lists of Repos
Browse files Browse the repository at this point in the history
  • Loading branch information
JonGretar committed Oct 21, 2014
1 parent 830107f commit 8321118
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Tentacool + Cat = Tentacat
* Users
* Emails
* Keys
* Repositories
* Webhooks

Documentation can be found [here](http://edgurgel.github.io/tentacat/)

Expand Down
52 changes: 52 additions & 0 deletions lib/tentacat/repositories.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
defmodule Tentacat.Repositories do
import Tentacat
alias Tentacat.Client
@moduledoc """
The Repository Webhooks API allows repository admins to manage the post-receive hooks for a repository.
"""

@doc """
List current user's Repositories.
## Example
Tentacat.Repositories.list_mine(client)
More info at: https://developer.github.com/v3/repos/#list-your-repositories
"""
@spec list_mine(Client.t) :: Tentacat.response
def list_mine(client) do
get "user/repos", client.auth
end

@doc """
List users Repositories.
## Example
Tentacat.Repositories.list_users("steve", client)
More info at: https://developer.github.com/v3/repos/#list-user-repositories
"""
@spec list_users(binary, Client.t) :: Tentacat.response
def list_users(owner, client \\ %Client{}) do
get "users/#{owner}/repos", client.auth
end

@doc """
List organizations Repositories.
## Example
Tentacat.Repositories.list_orgs("elixir-lang", client)
More info at: https://developer.github.com/v3/repos/#list-organization-repositories
"""
@spec list_orgs(binary, Client.t) :: Tentacat.response
def list_orgs(org, client \\ %Client{}) do
get "orgs/#{org}/repos", client.auth
end


end

0 comments on commit 8321118

Please sign in to comment.