package swhid

  1. Overview
  2. Docs
val instance : string Stdlib.ref

The base URL of the software heritage instance used, defaults to https://archive.softwareheritage.org.

val content_unsafe : hash_type:string -> Lang.object_id -> (string, string) Stdlib.result

Same as content but expects an object identifier hash directly.

val content : Lang.identifier -> (string, string) Stdlib.result

For a given content identifier, compute an URL from which the content can be downloaded.

val directory_unsafe : Lang.object_id -> (string, string) Stdlib.result

Same as directory but expects an object identifier hash directly.

val directory : Lang.identifier -> (string, string) Stdlib.result

For a given directory identifier, compute an URL from which the directory can be downloaded.

val revision_unsafe : Lang.object_id -> (string, string) Stdlib.result

Same as revision but expects an object identifier hash directly.

val revision : Lang.identifier -> (string, string) Stdlib.result

For a given revision identifier, compute an URL from which the revision can be downloaded.

val release_unsafe : Lang.object_id -> (string, string) Stdlib.result

Same as release but expects an object identifier hash directly.

val release : Lang.identifier -> (string, string) Stdlib.result

For a given release identifier, compute an URL from which the release can be downloaded.

val snapshot_unsafe : Lang.object_id -> ((string, string) Stdlib.result list, string) Stdlib.result

Same as snapshot but expects an object identifier hash directly.

val snapshot : Lang.identifier -> ((string, string) Stdlib.result list, string) Stdlib.result

For a given snapshot identifier, compute a list of URL from which the snapshot's branches can be downloaded.

val any : Lang.identifier -> (string list, string list) Stdlib.Result.t

For any object identifier, compute a list of URLs from which the object can be downloaded. For all kind of object, the list should contain a single URL except for snapshot objects which may lead to a list of many URLs (one URL per branch). In the snapshot branch, if a single error is encountered, then the result will be an Error type with the list of all errors, and no URL is returned (even if we succeeded to compute some of them).

OCaml

Innovation. Community. Security.