package dkml-install

  1. Overview
  2. Docs

Source file registry_intf.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
module type Intf = sig
  type t
  (** The type of the component registry *)

  (** The type of the component selector. Either all components,
      or just the specified components plus all of their dependencies. *)
  type component_selector =
    | All_components
    | Just_named_components_plus_their_dependencies of string list

  val get : unit -> t
  (** Get a reference to the global component registry *)

  val add_component :
    ?raise_on_error:bool ->
    t ->
    (module Dkml_install_api.Component_config) ->
    unit
  (** [add_component ?raise_on_error registry component] adds the component to the registry.
      
      Ordinarily if there is an error a process {!exit} is performed. Set
      [raise_on_error] to [true] to raise an {!Invalid_argument} error instead. *)

  val validate : ?raise_on_error:bool -> t -> unit
  (** [validate ?raise_on_error registry] succeeds if and only if all dependencies of all
      [add_component registry] have been themselves added.
        
      Ordinarily if there is an error a process {!exit} is performed. Set
      [raise_on_error] to [true] to raise an {!Invalid_argument} error instead. *)

  val install_eval :
    t ->
    selector:component_selector ->
    f:
      ((module Dkml_install_api.Component_config) ->
      'a Dkml_install_api.Forward_progress.t) ->
    fl:Dkml_install_api.Forward_progress.fatal_logger ->
    'a list Dkml_install_api.Forward_progress.t
  (** [install_eval registry ~f ~fl] iterates through the registry in dependency order
      using component's {!Dkml_install_api.Component_config.install_depends_on} value,
      executing function [f] on each component configuration.
    
      Errors will go to the fatal logger [fl]. *)

  val uninstall_eval :
    t ->
    selector:component_selector ->
    f:
      ((module Dkml_install_api.Component_config) ->
      'a Dkml_install_api.Forward_progress.t) ->
    fl:Dkml_install_api.Forward_progress.fatal_logger ->
    'a list Dkml_install_api.Forward_progress.t
  (** [uninstall_eval registry ~f ~fl] iterates through the registry in reverse
      dependency order using component's {!Dkml_install_api.Component_config.install_depends_on} value,
      executing function [f] on each component configuration.

      Errors will go to the fatal logger [fl]. *)

  (** The module [Private] is meant for internal use only. *)
  module Private : sig
    val reset : unit -> unit
  end
end
OCaml

Innovation. Community. Security.