package swhid

  1. Overview
  2. Docs

Module Swhid.DownloadSource

Sourceval instance : string ref

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

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

Same as content but expects an object identifier hash directly.

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

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

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

Same as directory but expects an object identifier hash directly.

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

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

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

Same as revision but expects an object identifier hash directly.

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

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

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

Same as release but expects an object identifier hash directly.

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

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

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

Same as snapshot but expects an object identifier hash directly.

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

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

Sourceval any : Lang.identifier -> (string list, string list) 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.