Liking cljdoc? Tell your friends :D

com.blockether.vis.internal.extension.registry

Three global registries in one place: channels, providers, commands.

Each descriptor is checked by a local predicate before entering its process registry.

Channel registry (:channel/id keyword): channel build + validate a descriptor register-channel! register, idempotent on :channel/id deregister-channel! remove by id registered-channels all entries, vec channel-by-id lookup by id by-cmd lookup by :channel/cmd

Provider registry (:provider/id keyword): provider build + validate a descriptor register-provider! register, idempotent on :provider/id deregister-provider! remove by id registered-providers all entries, vec provider-by-id lookup by id

Command registry ([:cmd/parent :cmd/name] tuple key): command build + validate a descriptor resolve-subcommands static vec or dynamic 0-arg fn -> vec register-cmd! register, idempotent on [parent name] deregister-cmd! remove by [parent name] registered-commands all entries, vec (registration order) registered-under filter by parent path

Channel mounting: channel-subcommands compose vis-agent channels subcommand vec from the channel registry + any commands registered with :cmd/parent ["channels"]. Loading this ns also registers the vis-agent channels parent itself. Parsing / help rendering / dispatch utilities live in com.blockether.vis.internal.commandline. The closed initialization manifest lives in com.blockether.vis.internal.extension.manifest.

Three global registries in one place: channels, providers, commands.

Each descriptor is checked by a local predicate before entering its process registry.

Channel registry (`:channel/id` keyword):
  channel                  build + validate a descriptor
  register-channel!        register, idempotent on :channel/id
  deregister-channel!      remove by id
  registered-channels      all entries, vec
  channel-by-id            lookup by id
  by-cmd                   lookup by :channel/cmd

Provider registry (`:provider/id` keyword):
  provider                 build + validate a descriptor
  register-provider!       register, idempotent on :provider/id
  deregister-provider!     remove by id
  registered-providers     all entries, vec
  provider-by-id           lookup by id

Command registry (`[:cmd/parent :cmd/name]` tuple key):
  command                  build + validate a descriptor
  resolve-subcommands      static vec or dynamic 0-arg fn -> vec
  register-cmd!            register, idempotent on [parent name]
  deregister-cmd!          remove by [parent name]
  registered-commands      all entries, vec (registration order)
  registered-under         filter by parent path

Channel mounting:
  channel-subcommands      compose `vis-agent channels` subcommand vec
                           from the channel registry + any commands
                           registered with `:cmd/parent ["channels"]`.
                           Loading this ns also registers the
                           `vis-agent channels` parent itself.
Parsing / help rendering / dispatch utilities live in
`com.blockether.vis.internal.commandline`. The closed initialization manifest
lives in `com.blockether.vis.internal.extension.manifest`.
raw docstring

by-cmdclj

(by-cmd cmd)

Lookup the channel whose :channel/cmd equals cmd. Returns nil when no channel claims that command.

Lookup the channel whose :channel/cmd equals `cmd`. Returns nil
when no channel claims that command.
sourceraw docstring

channelclj

(channel descriptor)

Build and validate a channel descriptor map.

Build and validate a channel descriptor map.
sourceraw docstring

channel-by-idclj

(channel-by-id id)

Lookup the channel by :channel/id. Returns nil when absent.

Lookup the channel by :channel/id. Returns nil when absent.
sourceraw docstring

channel-registryclj

source

channel-subcommandsclj

(channel-subcommands)

Compose subcommands for the vis-agent channels parent from TWO sources:

  1. Every entry in the channel registry (TUI, ...)
  2. Every commandline extension registered with :cmd/parent ["channels"] (escape hatch for non-channel adapters that still want to live under vis-agent channels)

Source #1 wins on name collision - channels are first-class so a stray extension can't shadow a real channel name. Both sorted together so help output is alphabetic.

Compose subcommands for the `vis-agent channels` parent from TWO sources:

  1. Every entry in the channel registry (TUI, ...)
  2. Every commandline extension registered with
     `:cmd/parent ["channels"]` (escape hatch for non-channel
     adapters that still want to live under `vis-agent channels`)

Source #1 wins on name collision - channels are first-class so a
stray extension can't shadow a real channel name. Both sorted
together so help output is alphabetic.
sourceraw docstring

channel?clj

(channel? x)
source

commandclj

(command descriptor)

Build and validate a command map without realizing dynamic children.

Build and validate a command map without realizing dynamic children.
sourceraw docstring

command-registryclj

source

command?clj

(command? x)
source

deregister-channel!clj

(deregister-channel! id)
source

deregister-cmd!clj

(deregister-cmd! nm)
(deregister-cmd! parent nm)

Remove a registered command. parent defaults to [] (top-level).

Remove a registered command. `parent` defaults to `[]` (top-level).
sourceraw docstring

deregister-provider!clj

(deregister-provider! id)
source

providerclj

(provider descriptor)

Build and validate a provider descriptor.

Build and validate a provider descriptor.
sourceraw docstring

provider-by-idclj

(provider-by-id id)

Lookup a provider by :provider/id. Returns nil when absent.

Lookup a provider by `:provider/id`. Returns nil when absent.
sourceraw docstring

provider-registryclj

source

provider?clj

(provider? x)
source

register-channel!clj

(register-channel! spec)

Register a channel in the global registry. Idempotent on :channel/id - re-registering replaces the prior spec. Returns the validated channel.

Register a channel in the global registry.
Idempotent on :channel/id - re-registering replaces the prior spec.
Returns the validated channel.
sourceraw docstring

register-cmd!clj

(register-cmd! spec)

Register a command in the global registry. Idempotent on [:cmd/parent :cmd/name] - re-registering replaces the prior entry, useful for REPL-driven development. Returns the validated command map.

Register a command in the global registry. Idempotent on
`[:cmd/parent :cmd/name]` - re-registering replaces the prior
entry, useful for REPL-driven development. Returns the validated
command map.
sourceraw docstring

register-provider!clj

(register-provider! spec)

Register a provider in the global registry. Idempotent on :provider/id - re-registering replaces the previous descriptor. Returns the validated provider.

Register a provider in the global registry. Idempotent on
`:provider/id` - re-registering replaces the previous descriptor.
Returns the validated provider.
sourceraw docstring

registered-channelsclj

(registered-channels)

All globally registered channels as a vector.

All globally registered channels as a vector.
sourceraw docstring

registered-commandsclj

(registered-commands)

Return all registered commands as a vector, in registration order.

Return all registered commands as a vector, in registration order.
sourceraw docstring

registered-providersclj

(registered-providers)
source

registered-underclj

(registered-under parent-path)

Return the vector of registered commands whose :cmd/parent equals parent-path (a vector of names). Use this from a parent command's :cmd/subcommands slot - typically as a 0-arg fn so newly registered children appear immediately:

{:cmd/name "extension"
 :cmd/doc  "Run an extension command."
 :cmd/subcommands #(registered-under ["extension"])}
Return the vector of registered commands whose `:cmd/parent` equals
`parent-path` (a vector of names). Use this from a parent command's
`:cmd/subcommands` slot - typically as a 0-arg fn so newly
registered children appear immediately:

    {:cmd/name "extension"
     :cmd/doc  "Run an extension command."
     :cmd/subcommands #(registered-under ["extension"])}
sourceraw docstring

resolve-subcommandsclj

(resolve-subcommands cmd)

Return the static vector of subcommands, calling the dynamic fn when needed. Returns [] when the command has no children.

Return the static vector of subcommands, calling the dynamic fn
when needed. Returns `[]` when the command has no children.
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