Abstraction of the GitHub API, suitable for DataKit clients
Library datakit-github

GitHub snapshot

type t

The type for GitHub snapshot.

val pp : t Fmt.t

pp is the pretty-printer for snapshots.

val empty : t

The empty snapshot.

val is_empty : t -> bool

is_empty t is true if t is empty.

val v : repos:Repo.Set.t -> commits:Commit.Set.t -> status:Status.Set.t -> prs:PR.Set.t -> refs:Ref.Set.t -> t

v ~repos ~commits ~status ~prs ~refs is a new snapshot t with repositories reps, commits commits, pull-requests prs, build statuses status and Git references refs.

val compare : t -> t -> int

compare is the comparison function for snapshots.

val union : t -> t -> t

union x y is the union of the snapshots x and y.

val prune : t -> t

prune t is t where all the objects related to closed PRs have been removed.


type diff

The type for snapshot diffs.

val diff : t -> t -> diff

diff x y is the difference between x and y.


val elts : t -> Elt.Set.t

elts t is the collection of elements of t.

val repos : t -> Repo.Set.t

repos t are t's repository.

val prs : t -> PR.Set.t

prs t are t's pull-requests.

val commits : t -> Commit.Set.t

commits t are t's commits.

val status : t -> Status.Set.t

status t are t's build status.

val refs : t -> Ref.Set.t

refs t are t's Git references.

val with_elt : Elt.t -> t -> t

with_elt e t it t with the element e added.

val with_elts : Elt.Set.t -> t -> t

with_elts is like with_elt but for a collection of elements.

val without_repos : Repo.Set.t -> t -> t
val with_events : Event.t list -> t -> t
val find : -> t -> Elt.t option

find id t finds the element with ID id in t.