package dkml-install

  1. Overview
  2. Docs
API and registry for Diskuv OCaml (DKML) installation components

Install

dune-project
 Dependency

Authors

Maintainers

Sources

dkml-install-0.3.1.tbz
sha256=e48dddd64742d654c962be7138539ef3811298b1119a29e043553f07f7621960
sha512=0c21208b0e8e046314139d30c26f194e4e767d14696ea3c3e0d3ddd7c5e777887f0ddd83188008824d14dd14d0ce89af92e72984d598541a418e1fbe248d2d0e

doc/src/dkml-install.register/validate.ml.html

Source file validate.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
open Dkml_install_api
open Astring

let validate (module Cfg : Component_config) =
  let alphanumeric c =
    (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || c = '-'
  in
  if String.for_all alphanumeric Cfg.component_name then Ok ()
  else
    Error
      (Fmt.str
         "[19c415af]: The component_name must be alphanumeric with only dashes \
          (-) allowed. Instead the component name was: %s"
         Cfg.component_name)