Documentation
¶
Overview ¶
Package contract wires Weave into the Forge dashboard's contract path. It registers the `weave` contributor and answers its intents from the Weave engine. Handlers call engine methods only, never the store, so a fix in the engine reaches the dashboard and Weave's HTTP API alike.
Index ¶
Constants ¶
const ContributorName = "weave"
ContributorName is the join key with packages/plugin-weave's `extension` field and matches the extension's name. A mismatch hides the React plugin with no error anywhere.
const StalledAfter = engine.DefaultStalledAfter
StalledAfter is the default stalled_after: how long a document may sit in processing without a heartbeat before recovery fails it and the dashboard flags it. An ingest sends a heartbeat after each step, so a document this far behind its last update has almost certainly died with its process. The dashboard uses the engine's own setting (engine.RecoveryConfig), and this value only when the engine has none.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(d *dispatcher.Dispatcher, reg contract.Registry, wreg contract.WardenRegistry, deps Deps) error
Register loads and validates the embedded manifest, registers the `weave` contributor with reg, and binds every handler. A handler bound to an intent the manifest does not declare is a build mistake and fails here rather than at the first request.
Types ¶
type Deps ¶
type Deps struct {
// Engine answers every intent. Required.
Engine *engine.Engine
// Logger receives an Error entry for every error mapped to
// CodeInternal. Optional.
Logger forge.Logger
// Now is the clock the stalled check reads. Optional; nil means
// time.Now.
Now func() time.Time
// Tenant resolves the Weave tenant for a dashboard request. Nil reads
// weave.TenantFromContext(ctx). An empty result or an error refuses the
// request with PERMISSION_DENIED.
Tenant func(ctx context.Context, p contract.Principal) (string, error)
}
Deps bundles what the handlers need.