GhEx.Activity (gh_ex v0.3.4)

Copy Markdown View Source

Convenience functions for GitHub activity events and repository starring.

Event feeds are delayed activity streams rather than real-time delivery; use webhooks when latency matters. Every list has a lazy stream_* companion. Watching/subscription endpoints are intentionally outside this module's scope; notification-thread subscriptions live in GhEx.Notifications.

Except for the documented boolean body returned by starred?/4, these thin wrappers return the same {:ok, body, meta} / {:error, reason} shape as GhEx.REST and pass opts through to Req.

Summary

Functions

Lists public events for an organization.

Lists public events across GitHub.

Lists events for a repository.

Lists a repository's stargazers.

Lists repositories starred by a user.

Lists events performed by a user.

Stars a repository for the authenticated user.

Checks whether the authenticated user has starred a repository.

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

Auto-paginates public events across GitHub into a lazy Stream.

Auto-paginates repository events into a lazy Stream.

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

Auto-paginates repositories starred by a user into a lazy Stream.

Auto-paginates events performed by a user into a lazy Stream.

Unstars a repository for the authenticated user.

Functions

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

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

Lists public events for an organization.

list_public_events(client, opts \\ [])

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

Lists public events across GitHub.

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

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

Lists events for a repository.

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

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

Lists a repository's stargazers.

Pass an application/vnd.github.star+json Accept header to include each star's timestamp. GitHub may restrict this listing to repository admins and collaborators.

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

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

Lists repositories starred by a user.

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

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

Lists events performed by a user.

When authenticated as username, the response may include private events; otherwise GitHub returns only public events.

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

Stars a repository for the authenticated user.

starred?(client, owner, repo, opts \\ [])

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

Checks whether the authenticated user has starred a repository.

Returns {:ok, true, meta} for GitHub's 204 response and {:ok, false, meta} for its 404 absence response. Other failures remain {:error, %GhEx.Error{}}. A conditional 304 is returned as {:ok, :not_modified, meta}, consistent with GhEx.REST.

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

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

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

stream_public_events(client, opts \\ [])

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

Auto-paginates public events across GitHub into a lazy Stream.

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

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

Auto-paginates repository events into a lazy Stream.

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

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

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

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

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

Auto-paginates repositories starred by a user into a lazy Stream.

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

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

Auto-paginates events performed by a user into a lazy Stream.

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

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

Unstars a repository for the authenticated user.