package dkml-install

  1. Overview
  2. Docs

The Component_registry is a global registry of all components that have been registered until now.

Component authors should follow this sequence:

open Dkml_install_api

module Component : Component_config = struct
  include Default_component_config
  let component_name = "...the..component..name..."
  (** Redefine any other values you want to override *)
end
let reg = Component_registry.get ()
let () = Component_registry.add_component reg (module Component : Component_config)
type t

The type of the component registry

type component_selector =
  1. | All_components
  2. | Just_named_components_plus_their_dependencies of string list

The type of the component selector. Either all components, or just the specified components plus all of their dependencies.

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 -> Dkml_install_register__.Register_types.install_direction -> unit

validate ?raise_on_error registry direction 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.

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.

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.

module Private : sig ... end

The module Private is meant for internal use only.

OCaml

Innovation. Community. Security.