integrations

package
v0.0.0-...-408fa6f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package integrations is the composition root's view of the installed integration set. Each integration lives in its own subtree (internal/integrations/<key>) and is listed once in registry.go's All(). Adding an integration is one tree + one registry line — no init()-time self-registration.

Import-direction rule (mirrors the FK rule for schemas): integration trees MAY import core packages (internal/db, internal/integration, internal/server's exported deps, ...); core packages MUST NOT import integration trees. Only composition roots — cmd/start.go and internal/migrate/sources.go — consume this package.

Cycle note: integration subpackages (e.g. internal/integrations/fedwiki) deliberately do NOT import this package. Their New() constructors return a concrete type that structurally satisfies Integration; registry.go (in this package) is the only place the concrete types are named as the interface. This keeps the dependency edge one-directional — this package imports the subpackages, never the reverse — which a two-way import would turn into a compile-time cycle.

This package deliberately does NOT define a routes capability interface (see internal/server.RouteProvider instead): internal/migrate imports this package (Sources loops All()), and internal/server's own DB-backed tests (internal test files, package server) import internal/migrate — so if this package imported internal/server to reference its Deps type, internal/server's test binary would cycle (server -> migrate -> integrations -> server). Defining RouteProvider at the point of use (internal/server, which cmd/start.go already imports to build Config) avoids that without weakening the capability-discovery pattern: the composition root still type-asserts each Integration from All() against server.RouteProvider exactly as it would against a hook declared here.

A workflows capability interface is excluded for the same reason: internal/workflows.WorkflowProvider is declared in internal/workflows instead of here, so that internal/workflows (which this package's registered integrations import, e.g. internal/integrations/stripe -> internal/workflows/stripe) never has to import this package to reference its own capability type — keeping the design's import- direction rule (internal/server and internal/workflows end this change with zero integration imports; see design.md Decision 3) true by construction rather than by incidental non-cycling. cmd/start.go, which already imports both packages to build Config and WorkerConfig, type-asserts against workflows.WorkflowProvider exactly as it does against server.RouteProvider.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Integration

type Integration interface {
	// Key is the integration's short identifier (e.g. "fedwiki",
	// "stripe"). It must match the Key in Provider()'s manifest.
	Key() string

	// Provider returns the provider-registry manifest source, consumed by
	// internal/integration.RegisterProviders at boot.
	Provider() integration.ProviderSource

	// MigrationSource returns the integration's migration source,
	// consumed by internal/migrate.Sources.
	MigrationSource() db.MigrationSource
}

Integration is the mandatory capability every registered integration implements. Optional capabilities (routes, workflows, config, UI assets) are discovered by type-asserting an Integration against the interfaces below; an integration lacking a capability simply doesn't implement the corresponding interface.

func All

func All() []Integration

All returns every registered integration. Adding an integration means adding one tree plus one element here — nothing else in this package changes. Core's migration source always runs first (see internal/db.BaseSources / internal/migrate); the relative order of the integrations below is insignificant — each runs against its own migration ledger and there are no integration-to-integration FK edges.

type UIProvider

type UIProvider interface {
	Templates() fs.FS
	Static() fs.FS
}

UIProvider is implemented by integrations that ship templates and/or static assets. Both filesystems are key-namespaced: template files, defined template names, and static asset paths must be prefixed with the integration's key.

Directories

Path Synopsis
Package discourse is the Discourse integration: forum access delivered as Discourse group membership, driven by the org-held `discourse_posting` boolean entitlement.
Package discourse is the Discourse integration: forum access delivered as Discourse group membership, driven by the org-held `discourse_posting` boolean entitlement.
client
Package client is the Discourse integration's thin admin-API client.
Package client is the Discourse integration's thin admin-API client.
discoursetest
Package discoursetest is an in-process fake Discourse server for the Discourse integration's tests (design.md D7: a real Discourse per worktree stack would violate the parallel-worktree contract's spirit, so e2e and unit tests run against this fake instead).
Package discoursetest is an in-process fake Discourse server for the Discourse integration's tests (design.md D7: a real Discourse per worktree stack would violate the parallel-worktree contract's spirit, so e2e and unit tests run against this fake instead).
discoursetest/fakeserver command
Command fakeserver runs the fake Discourse on a fixed port so the member console (a separate process) can be booted against it — the walkthrough e2e path (design.md D7: no real Discourse in the test stack).
Command fakeserver runs the fake Discourse on a fixed port so the member console (a separate process) can be booted against it — the walkthrough e2e path (design.md D7: no real Discourse in the test stack).
linkage
Package linkage establishes person↔Discourse-user links (discourse.
Package linkage establishes person↔Discourse-user links (discourse.
web
Package web holds the Discourse integration's HTTP handlers: the webhook endpoint (this file) and the operator surface.
Package web holds the Discourse integration's HTTP handlers: the webhook endpoint (this file) and the operator surface.
workflows
Package workflows holds the Discourse integration's Temporal workflows and activities: the periodic group-sync sweep (the level-triggered correctness backbone — design.md D3) and the targeted per-person reconcile that webhook events and link establishment trigger.
Package workflows holds the Discourse integration's Temporal workflows and activities: the periodic group-sync sweep (the level-triggered correctness backbone — design.md D3) and the targeted per-person reconcile that webhook events and link establishment trigger.
Package fedwiki is the FedWiki integration: it satisfies internal/ integrations.Integration's mandatory capability (Key, Provider, MigrationSource), internal/server.RouteProvider's optional routes capability, internal/workflows.WorkflowProvider's optional workflows capability, internal/config.ConfigProvider's optional config capability, and internal/integrations.UIProvider's optional UI-assets capability.
Package fedwiki is the FedWiki integration: it satisfies internal/ integrations.Integration's mandatory capability (Key, Provider, MigrationSource), internal/server.RouteProvider's optional routes capability, internal/workflows.WorkflowProvider's optional workflows capability, internal/config.ConfigProvider's optional config capability, and internal/integrations.UIProvider's optional UI-assets capability.
web
Package web is the FedWiki integration's HTTP surface: the member-facing JSON API (this file), the HTMX partials backing the member dashboard's site widget (partials.go), and the read-only operator page (operator.go).
Package web is the FedWiki integration's HTTP surface: the member-facing JSON API (this file), the HTMX partials backing the member dashboard's site widget (partials.go), and the read-only operator page (operator.go).
Package stripe is the Stripe integration, PARTIALLY moved into this tree per design.md Decision 6: Stripe extracts its cleanly separable parts (module, workflows) while the payments-seam files stay in core as a follow-up.
Package stripe is the Stripe integration, PARTIALLY moved into this tree per design.md Decision 6: Stripe extracts its cleanly separable parts (module, workflows) while the payments-seam files stay in core as a follow-up.
web
Package web holds Stripe's HTTP handlers (the webhook receiver), moved from internal/server per openspec/changes/integration-extraction task 3.3.
Package web holds Stripe's HTTP handlers (the webhook receiver), moved from internal/server per openspec/changes/integration-extraction task 3.3.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL