GhEx.Repositories (gh_ex v0.3.2)

Copy Markdown View Source

Convenience functions for the GitHub Repositories REST API.

Thin wrappers over GhEx.REST that fill in the endpoint path and return the same {:ok, body, meta} / {:error, reason} shape; opts pass through to Req (so :params, headers, and a Req.Test plug all work). For an endpoint without a wrapper, call GhEx.REST directly.

Summary

Functions

Creates a repository in an organization. attrs is the JSON body (name, private, ...).

Lists branches on a repository.

Lists commits on a repository. Use params: for sha, path, since, until.

Lists repositories for an organization. Use params: for type, sort, per_page.

Lists public repositories for a user.

Auto-paginates a repository's branches into a lazy Stream.

Auto-paginates a repository's commits into a lazy Stream.

Auto-paginates an organization's repositories into a lazy Stream.

Auto-paginates a user's public repositories into a lazy Stream.

Functions

create_in_org(client, org, attrs, opts \\ [])

@spec create_in_org(GhEx.Client.t(), String.t(), map(), keyword()) ::
  GhEx.REST.result()

Creates a repository in an organization. attrs is the JSON body (name, private, ...).

delete(client, owner, repo, opts \\ [])

@spec delete(GhEx.Client.t(), String.t(), String.t(), keyword()) :: GhEx.REST.result()

Deletes a repository.

get(client, owner, repo, opts \\ [])

Gets a repository.

list_branches(client, owner, repo, opts \\ [])

@spec list_branches(GhEx.Client.t(), String.t(), String.t(), keyword()) ::
  GhEx.REST.result()

Lists branches on a repository.

list_commits(client, owner, repo, opts \\ [])

@spec list_commits(GhEx.Client.t(), String.t(), String.t(), keyword()) ::
  GhEx.REST.result()

Lists commits on a repository. Use params: for sha, path, since, until.

list_for_org(client, org, opts \\ [])

@spec list_for_org(GhEx.Client.t(), String.t(), keyword()) :: GhEx.REST.result()

Lists repositories for an organization. Use params: for type, sort, per_page.

list_for_user(client, username, opts \\ [])

@spec list_for_user(GhEx.Client.t(), String.t(), keyword()) :: GhEx.REST.result()

Lists public repositories for a user.

stream_branches(client, owner, repo, opts \\ [])

@spec stream_branches(GhEx.Client.t(), String.t(), String.t(), keyword()) ::
  Enumerable.t()

Auto-paginates a repository's branches into a lazy Stream.

stream_commits(client, owner, repo, opts \\ [])

@spec stream_commits(GhEx.Client.t(), String.t(), String.t(), keyword()) ::
  Enumerable.t()

Auto-paginates a repository's commits into a lazy Stream.

stream_for_org(client, org, opts \\ [])

@spec stream_for_org(GhEx.Client.t(), String.t(), keyword()) :: Enumerable.t()

Auto-paginates an organization's repositories into a lazy Stream.

stream_for_user(client, username, opts \\ [])

@spec stream_for_user(GhEx.Client.t(), String.t(), keyword()) :: Enumerable.t()

Auto-paginates a user's public repositories into a lazy Stream.

update(client, owner, repo, attrs, opts \\ [])

@spec update(GhEx.Client.t(), String.t(), String.t(), map(), keyword()) ::
  GhEx.REST.result()

Updates a repository.