Debian Codegraph @

vendor/opam/src/core/opamSWHID.mli

raw
1 (**************************************************************************)
2 (* *)
3 (* Copyright 2022 OCamlPro *)
4 (* *)
5 (* All rights reserved. This file is distributed under the terms of the *)
6 (* GNU Lesser General Public License version 2.1, with the special *)
7 (* exception on linking described in the file LICENSE. *)
8 (* *)
9 (**************************************************************************)
10
11 (* Software Heritage Identifiers *)
12 type t
13
14 include OpamStd.ABSTRACT with type t := t
15 val hash : t -> string
16
17 (** Check url validity regarding its form:
18 http backend and swhid path prefix [swhid.opam.ocaml.org] *)
19 val is_valid: OpamUrl.t -> bool
20
21 (** Extract an swhid from an url *)
22 val of_url: OpamUrl.t -> t option
23
24 (** Create an opam url from an swhid, in the form of
25 https://swhid.opam.ocaml.org/swhi *)
26 val to_url: t -> OpamUrl.t
27
28 (** Compute and SWH identifier from the given directory *)
29 val compute: OpamFilename.Dir.t -> string option