BorsNG.GitHub (Bors-NG v0.1.0) View Source

Wrappers around the GitHub REST API.

Link to this section Summary

Types

A repository connection; it packages a repository with the permissions to access it.

An authentication token; this may be a raw token (as on oAuth) or an installation xref (in which case the server will look it up).

Link to this section Types

Specs

tcollaborator() :: %{user: tuser(), perms: tuser_repo_perms()}

Specs

tcommitter() :: %{name: bitstring(), email: bitstring()}

Specs

tconn() :: {ttoken(), number()} | {ttoken(), number()}

A repository connection; it packages a repository with the permissions to access it.

Specs

tpr() :: BorsNG.GitHub.Pr.t()

Specs

trepo() :: BorsNG.GitHub.Repo.t()

Specs

trepo_perm() :: :admin | :push | :pull

Specs

tstatus() :: :ok | :running | :error

Specs

ttoken() :: {:installation, number()} | {:raw, binary()}

An authentication token; this may be a raw token (as on oAuth) or an installation xref (in which case the server will look it up).

Specs

tuser() :: BorsNG.GitHub.User.t()

Specs

tuser_repo_perms() :: %{admin: boolean(), push: boolean(), pull: boolean()}

Link to this section Functions

Link to this function

belongs_to_team?(repo_conn, org, team_slug, username)

View Source

Specs

belongs_to_team?(tconn(), String.t(), String.t(), String.t()) :: boolean()
Link to this function

create_commit(repo_conn, info)

View Source

Specs

create_commit(tconn(), %{
  tree: bitstring(),
  parents: [bitstring()],
  commit_message: bitstring(),
  committer: tcommitter() | nil
}) :: {:ok, binary()} | {:error, term(), term()}
Link to this function

create_commit!(repo_conn, info)

View Source

Specs

create_commit!(tconn(), %{
  tree: bitstring(),
  parents: [bitstring()],
  commit_message: bitstring(),
  committer: tcommitter() | nil
}) :: binary()
Link to this function

delete_branch!(repo_conn, branch)

View Source

Specs

delete_branch!(tconn(), binary()) :: :ok
Link to this function

force_push!(repo_conn, sha, to)

View Source

Specs

force_push!(tconn(), binary(), binary()) :: binary()

Specs

get_app!() :: String.t()
Link to this function

get_branch!(repo_conn, from)

View Source

Specs

get_branch!(tconn(), binary()) :: %{commit: bitstring(), tree: bitstring()}
Link to this function

get_collaborators_by_repo(repo_conn)

View Source

Specs

get_collaborators_by_repo(tconn()) :: {:ok, [tcollaborator()]} | :error
Link to this function

get_commit_reviews!(repo_conn, issue_xref, sha)

View Source

Specs

get_commit_reviews!(tconn(), integer() | bitstring(), binary()) :: map()
Link to this function

get_commit_status!(repo_conn, sha)

View Source

Specs

get_commit_status!(tconn(), binary()) :: %{required(binary()) => tstatus()}
Link to this function

get_file!(repo_conn, branch, path)

View Source

Specs

get_file!(tconn(), binary(), binary()) :: binary() | nil
Link to this function

get_installation_list!()

View Source

Specs

get_installation_list!() :: [integer()]
Link to this function

get_installation_repos!(token)

View Source

Specs

get_installation_repos!(ttoken()) :: [trepo()]
Link to this function

get_labels!(repo_conn, issue_xref)

View Source

Specs

get_labels!(tconn(), integer() | bitstring()) :: [bitstring()]
Link to this function

get_open_prs!(repo_conn)

View Source

Specs

get_open_prs!(tconn()) :: [tpr()]
Link to this function

get_open_prs_with_base!(repo_conn, base)

View Source

Specs

get_open_prs_with_base!(tconn(), binary()) :: [tpr()]
Link to this function

get_pr(repo_conn, pr_xref)

View Source

Specs

get_pr(tconn(), integer() | bitstring()) ::
  {:ok, BorsNG.GitHub.Pr.t()} | {:error, term()}
Link to this function

get_pr!(repo_conn, pr_xref)

View Source

Specs

get_pr!(tconn(), integer() | bitstring()) :: BorsNG.GitHub.Pr.t()
Link to this function

get_pr_commits(repo_conn, pr_xref)

View Source

Specs

get_pr_commits(tconn(), integer() | bitstring()) ::
  {:ok, [BorsNG.GitHub.Commit.t()]} | {:error, term()}
Link to this function

get_pr_commits!(repo_conn, pr_xref)

View Source

Specs

get_pr_commits!(tconn(), integer() | bitstring()) :: [BorsNG.GitHub.Commit.t()]
Link to this function

get_pr_files(repo_conn, pr_xref)

View Source

Specs

get_pr_files(tconn(), integer()) ::
  {:ok, [BorsNG.GitHub.File.t()]} | {:error, term()}
Link to this function

get_pr_files!(repo_conn, pr_xref)

View Source

Specs

get_pr_files!(tconn(), integer()) :: [BorsNG.GitHub.File.t()]
Link to this function

get_reviews!(repo_conn, issue_xref)

View Source

Specs

get_reviews!(tconn(), integer() | bitstring()) :: map()
Link to this function

get_user_by_login!(token, login)

View Source

Specs

get_user_by_login!(ttoken(), binary()) :: {:ok, tuser()} | :error | nil
Link to this function

map_changed_status(check_name)

View Source

Specs

map_changed_status(binary()) :: binary()
Link to this function

map_check_to_status(conclusion)

View Source

Specs

map_check_to_status(binary()) :: tstatus()
Link to this function

map_state_to_status(state)

View Source

Specs

map_state_to_status(binary()) :: tstatus()
Link to this function

map_status_to_state(state)

View Source

Specs

map_status_to_state(tstatus()) :: binary()
Link to this function

merge_branch!(repo_conn, info)

View Source

Specs

merge_branch!(tconn(), %{
  from: bitstring(),
  to: bitstring(),
  commit_message: bitstring()
}) :: %{commit: binary(), tree: binary()} | :conflict
Link to this function

post_comment!(repo_conn, number, body)

View Source

Specs

post_comment!(tconn(), number(), binary()) :: :ok
Link to this function

post_commit_status!(repo_conn, arg)

View Source

Specs

post_commit_status!(tconn(), {binary(), tstatus(), binary(), binary()}) :: :ok
Link to this function

push(repo_conn, sha, to)

View Source

Specs

push(tconn(), binary(), binary()) ::
  {:ok, binary()} | {:error, term(), term(), term()}
Link to this function

push!(repo_conn, sha, to)

View Source

Specs

push!(tconn(), binary(), binary()) :: binary()
Link to this function

synthesize_commit!(repo_conn, info)

View Source

Specs

synthesize_commit!(tconn(), %{
  branch: bitstring(),
  tree: bitstring(),
  parents: [bitstring()],
  commit_message: bitstring(),
  committer: tcommitter() | nil
}) :: binary()
Link to this function

update_pr(repo_conn, pr)

View Source

Specs

update_pr(tconn(), BorsNG.GitHub.Pr.t()) ::
  {:ok, BorsNG.GitHub.Pr.t()} | {:error, term()}
Link to this function

update_pr!(repo_conn, pr)

View Source

Specs

Link to this function

update_pr_base(repo_conn, pr)

View Source

Specs

update_pr_base(tconn(), BorsNG.GitHub.Pr.t()) ::
  {:ok, BorsNG.GitHub.Pr.t()} | {:error, term()}
Link to this function

update_pr_base!(repo_conn, pr)

View Source

Specs

update_pr_base!(tconn(), BorsNG.GitHub.Pr.t()) :: BorsNG.GitHub.Pr.t()