Liking cljdoc? Tell your friends :D

grammar.core

Facade: discover a runtime, plan an intent, run it there, verify the effect.

(def rt (runtime/process-runtime {:id :rbash :argv ["/usr/bin/bash" "-r" "-c"] :env {...}})) (def prof (discover! rt)) (plan prof :sh [:write-file {:path "/tmp/x" :content "hi"}]) (realize! rt prof [:write-file {:path "/tmp/x" :content "hi"}])

Facade: discover a runtime, plan an intent, run it there, verify the effect.

(def rt (runtime/process-runtime {:id :rbash :argv ["/usr/bin/bash" "-r" "-c"] :env {...}}))
(def prof (discover! rt))
(plan prof :sh [:write-file {:path "/tmp/x" :content "hi"}])
(realize! rt prof [:write-file {:path "/tmp/x" :content "hi"}])
raw docstring

discover!clj

(discover! runtime)

Probe runtime and return its evidence-backed profile.

Probe runtime and return its evidence-backed profile.
sourceraw docstring

effectclj

(effect [op arg :as _intent])

Observe, with no run, whether the state that intent describes holds now: {:check kw :holds? bool}. Defined for state intents (:write-file, :ensure-dir, :remove-file); nil for :str and :run, whose effect exists only as the output of a run. The observation reads this JVM's filesystem, so it is only meaningful for a runtime that shares it.

Observe, with no run, whether the state that intent describes holds now:
{:check kw :holds? bool}. Defined for state intents (:write-file,
:ensure-dir, :remove-file); nil for :str and :run, whose effect exists only
as the output of a run. The observation reads this JVM's filesystem, so it
is only meaningful for a runtime that shares it.
sourceraw docstring

envclj

(env profile)
(env profile opts)

Planning environment with the built-in registry. opts pass through to grammar.solve/make-env (e.g. :admit).

Planning environment with the built-in registry. opts pass through to
grammar.solve/make-env (e.g. :admit).
sourceraw docstring

planclj

(plan profile lang intent)
(plan profile lang intent opts)

Pure: choose a realization of intent in lang under profile.

Pure: choose a realization of intent in lang under profile.
sourceraw docstring

plan-resolving!clj

(plan-resolving! runtime profile intent)
(plan-resolving! runtime profile intent opts)

Plan intent for runtime; when the plan is :blocked-on-unknown, probe its :needs on demand and plan again, until it stops changing. Returns {:result Result :profile profile-after}.

Plan intent for runtime; when the plan is :blocked-on-unknown, probe its
:needs on demand and plan again, until it stops changing.
Returns {:result Result :profile profile-after}.
sourceraw docstring

realize!clj

(realize! runtime profile intent)
(realize! runtime profile intent opts)

Plan intent for runtime's language under profile, execute it, verify it. A non-:ok plan is returned unchanged: nothing is run. opts :resolve true probes blocked unknowns on demand first (see plan-resolving!); the enriched profile is then under :profile-after.

Plan intent for runtime's language under profile, execute it, verify it.
A non-:ok plan is returned unchanged: nothing is run. opts :resolve true
probes blocked unknowns on demand first (see plan-resolving!); the
enriched profile is then under :profile-after.
sourceraw docstring

resolve!clj

(resolve! runtime profile caps)

Probe, in runtime, every cap in caps that is still :unknown and has an on-demand probe (e.g. :bin/git). Returns the enriched profile.

Probe, in runtime, every cap in caps that is still :unknown and has an
on-demand probe (e.g. :bin/git). Returns the enriched profile.
sourceraw docstring

verifyclj

(verify [op arg :as intent] run)

Check the observable effect of intent against what the run produced. A state intent verifies when the run exited 0 and its effect holds after it.

Check the observable effect of intent against what the run produced. A
state intent verifies when the run exited 0 and its effect holds after it.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close