GhEx.Search (gh_ex v0.3.2)

Copy Markdown View Source

Convenience functions for the GitHub Search REST API.

Each function takes the search query (the q parameter) and returns the same {:ok, body, meta} / {:error, reason} shape as GhEx.REST. Pass params: [sort: ..., order: ..., per_page: ...] for the other search options; q is merged in.

Summary

Functions

Searches issues and pull requests.

Auto-paginates a code search into a lazy Stream, unwrapping "items".

Auto-paginates a commit search into a lazy Stream, unwrapping "items".

Auto-paginates an issue and pull request search into a lazy Stream, unwrapping "items".

Auto-paginates a repository search into a lazy Stream of individual results, unwrapping the "items" array on each page (see GhEx.REST.stream/3).

Auto-paginates a user search into a lazy Stream, unwrapping "items".

Functions

code(client, query, opts \\ [])

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

Searches code.

commits(client, query, opts \\ [])

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

Searches commits.

issues_and_pull_requests(client, query, opts \\ [])

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

Searches issues and pull requests.

repositories(client, query, opts \\ [])

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

Searches repositories.

stream_code(client, query, opts \\ [])

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

Auto-paginates a code search into a lazy Stream, unwrapping "items".

stream_commits(client, query, opts \\ [])

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

Auto-paginates a commit search into a lazy Stream, unwrapping "items".

stream_issues_and_pull_requests(client, query, opts \\ [])

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

Auto-paginates an issue and pull request search into a lazy Stream, unwrapping "items".

stream_repositories(client, query, opts \\ [])

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

Auto-paginates a repository search into a lazy Stream of individual results, unwrapping the "items" array on each page (see GhEx.REST.stream/3).

stream_users(client, query, opts \\ [])

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

Auto-paginates a user search into a lazy Stream, unwrapping "items".

users(client, query, opts \\ [])

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

Searches users.