package swhid_core

  1. Overview
  2. Docs

Module to work with the different kinds of software artifacts a swhid can points to. They're documented here.

type t =
  1. | Content of string
    (*

    Contents (AKA "blobs"). the string parameter is the name of the hash function used for the computation, defaults to "sha1_git" and in most use cases you don't care about it.

    *)
  2. | Directory
    (*

    Directories.

    *)
  3. | Revision
    (*

    Revisions.

    *)
  4. | Release
    (*

    Releases.

    *)
  5. | Snapshot
    (*

    Snapshots.

    *)

The type of the different kinds of software artifacts.

val compare : t -> t -> int

compare x y returns 0 if x is equal to y, a negative integer if x is less than y, and a positive integer if x is greater than y.

val equal : t -> t -> bool

equal x y returns true iff x is equal to y.

val of_string : string -> (t, string) Stdlib.result

of_string s is Ok v if s is a valid kind of object, otherwise it is Error e. The valid kinds are "cnt", "dir", "rel", "rev" and "snp".

val pp : Stdlib.Format.formatter -> t -> unit

pp fmt v prints v on formatter fmt.

val to_string : t -> string

to_string v is the representation of v as a string.

OCaml

Innovation. Community. Security.