package datakit-github

  1. Overview
  2. Docs

Signature for the GitHub API.

type token

API tokens

The type for API tokens.

type 'a result = ('a, string) Result.result Lwt.t

The type for results.

val user_exists : token -> user:User.t -> bool result

exist_user t ~user is true iff user exists.

val repo_exists : token -> Repo.t -> bool result

exists_repo t r is true iff the repository r exists.

val repos : token -> user:User.t -> Repo.t list result

repos t ~user is the list of repositories owned by user user.

val status : token -> Commit.t -> Status.t list result

status t c returns the list of status attached to the commit c.

val set_status : token -> Status.t -> unit result

set_status t s updates Status.commit s's status with s.

val set_ref : token -> Ref.t -> unit result

set_ref t r updates the reference named Ref.name r with r.

val remove_ref : token -> Repo.t -> string list -> unit result

remove_ref t n removes the reference named n.

val set_pr : token -> PR.t -> unit result

set_pr t pr updates the PR number PR.number pr with pr.

val prs : token -> Repo.t -> PR.t list result

prs t r is the list of open pull-requests for the repo r.

val pr : token -> PR.id -> PR.t option result

pr t id is the contents of the pull request whose ID Is id.

val refs : token -> Repo.t -> Ref.t list result

refs t r is the list of references for the the repo r.

val ref : token -> Ref.id -> Ref.t option result

ref t id is the Git reference whose ID is id.

val events : token -> Repo.t -> Event.t list result

event t r is the list of events attached to the repository r. Note: can be slow/costly if multiple pages of events.

module Webhook : sig ... end
OCaml

Innovation. Community. Security.