Engine and named-pattern registries — the DIP swap points.
Two open sets, two registries:
engines id -> IPatternEngine ;; how to match patterns id -> Pattern ;; what to look for
A consumer names a pattern (:audit/readiness-probe) instead of carrying a
literal expression, so one definition serves every call site and a fix lands
in one place. resolve-pattern is PURE — the index is an argument, which is
what makes it testable and what lets a caller run against a private index.
Engine and named-pattern registries — the DIP swap points. Two open sets, two registries: engines id -> IPatternEngine ;; how to match patterns id -> Pattern ;; what to look for A consumer names a pattern (`:audit/readiness-probe`) instead of carrying a literal expression, so one definition serves every call site and a fix lands in one place. `resolve-pattern` is PURE — the index is an argument, which is what makes it testable and what lets a caller run against a private index.
(engine id)Result<IPatternEngine> for ID.
Result<IPatternEngine> for ID.
(pattern ref)Result<Pattern> for REF against the live index.
Result<Pattern> for REF against the live index.
(register-engine! engine)Register ENGINE under its engine-id, replacing any prior one. Returns it.
Register ENGINE under its engine-id, replacing any prior one. Returns it.
(register-pattern! pattern)Validate PATTERN and register it under its :pattern/id. Returns Result<Pattern>. An invalid pattern is refused, never stored.
Validate PATTERN and register it under its :pattern/id. Returns Result<Pattern>. An invalid pattern is refused, never stored.
(registered-engines)Snapshot of {engine-id -> IPatternEngine}.
Snapshot of {engine-id -> IPatternEngine}.
(registered-patterns)Snapshot of {pattern-id -> Pattern}.
Snapshot of {pattern-id -> Pattern}.
(resolve-pattern index ref)PURE. Result<Pattern> for REF against INDEX: an inline Pattern resolves to itself, a keyword to its registration.
PURE. Result<Pattern> for REF against INDEX: an inline Pattern resolves to itself, a keyword to its registration.
(unregister-engine! id)Drop the engine registered under ID. Returns it, or nil.
Drop the engine registered under ID. Returns it, or nil.
(unregister-pattern! id)Drop the pattern registered under ID. Returns it, or nil.
Drop the pattern registered under ID. Returns it, or nil.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |