Chronicle.Discovery.Report (cratis_chronicle v3.16.1)

Copy Markdown View Source

What the client found, across every artifact kind Chronicle.Artifacts knows how to discover: event types, event sources, reactors, reducers, declarative projections, read models, constraints, webhooks, event store subscriptions, seeders, migrations, global handlers and captures.

Built by Chronicle.Client at startup (Chronicle.Client.discovery_report/1), by Chronicle.Artifacts.report/1, and by mix chronicle.discover.

Summary

Functions

Builds a report from discovered or explicitly configured artifact module lists.

Counts artifacts of a given kind.

A full, multi-line rendering of every artifact grouped by kind — suitable for a debug-level log line or mix chronicle.discover's output.

The report before discovery has completed.

Selects artifacts of a given kind.

A one-line, per-kind count summary — suitable for an info-level log line.

Types

t()

@type t() :: %Chronicle.Discovery.Report{
  artifacts: [Chronicle.Discovery.Artifact.t()],
  has_run: boolean()
}

Functions

build(artifacts \\ %{})

@spec build(map() | keyword()) :: t()

Builds a report from discovered or explicitly configured artifact module lists.

Accepts a map or keyword list with the same keys Chronicle.Artifacts.discover/1 and Chronicle.Client's options use: :event_types, :event_sources, :reactors, :reducers, :projections, :read_models, :constraints, :webhooks, :event_store_subscriptions, :seeders, :migrations, :global_handlers, :captures. Every key is optional and defaults to [].

:warn_defaulted_ids (default true) controls whether a reactor, reducer or projection whose id defaults to its module name emits the one-time warning described on Chronicle.Discovery.DefaultedIdWarning.

count_of(report, kind)

Counts artifacts of a given kind.

format(report)

@spec format(t()) :: String.t()

A full, multi-line rendering of every artifact grouped by kind — suitable for a debug-level log line or mix chronicle.discover's output.

not_run()

@spec not_run() :: t()

The report before discovery has completed.

of_kind(report, kind)

Selects artifacts of a given kind.

summary(report)

@spec summary(t()) :: String.t()

A one-line, per-kind count summary — suitable for an info-level log line.