# fastabc/fastconf architecture

> Architecture diagram of the GitHub repository fastabc/fastconf, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fastabc/fastconf
- Repository: https://github.com/fastabc/fastconf
- Video tour (about a minute): https://gitdiagram.com/fastabc/fastconf/video

## Overview

FastConf is a Go configuration manager: it assembles layered local and provider inputs, runs a fail-safe typed reload pipeline, and atomically publishes immutable snapshots for lock-free reads. The graph highlights that workflow plus documented profiles, policy, provenance, watching, integrations, and CLI/sidecar capabilities. Edges follow the excerpts and README; where implementations were not sampled, documented capabilities are retained but uncertain internal links are omitted.

Main entry points: [`manager.go`](https://github.com/fastabc/fastconf/blob/master/manager.go) (Manager & Reload), [`pipeline.go`](https://github.com/fastabc/fastconf/blob/master/pipeline.go) (Validation & Policy), [`assemble.go`](https://github.com/fastabc/fastconf/blob/master/assemble.go) (Input Assembly), [`cmd/fastconfd`](https://github.com/fastabc/fastconf/tree/master/cmd/fastconfd) (fastconfd API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Inputs &amp; Providers"]
  node_config_sources["Config Files"]
  node_providers["Config Providers"]
end

subgraph group_pipeline["Reload Pipeline"]
  node_assembly["Input Assembly<br/>[assemble.go]"]
  node_scan["File Scanner<br/>[scan.go]"]
  node_merge["Layer Merge<br/>[commit.go]"]
  node_transform["Transforms &amp; Secrets"]
  node_typed_hooks["Typed Hooks<br/>[typed_hooks.go]"]
  node_decode["Typed Decode<br/>[decode.go]"]
  node_validation_policy["Validation &amp; Policy<br/>[pipeline.go]"]
end

subgraph group_runtime["Published Runtime"]
  node_manager["Manager &amp; Reload<br/>[manager.go]"]
  node_state[("Atomic State<br/>[state.go]")]
  node_watching["Change Watchers<br/>[file_watch.go]"]
  node_history[("History &amp; Rollback<br/>[history.go]")]
  node_provenance["Origins &amp; Explain<br/>[index.go]"]
  node_observers["Observers &amp; Events<br/>[observe.go]"]
  node_subscriptions["Subscriptions<br/>[subscribe.go]"]
end

subgraph group_extensions["Extensions"]
  node_policy_extensions["Policy Engines"]
  node_render["Config Rendering<br/>[render.go]"]
  node_metrics_tracing["Metrics &amp; Tracing"]
end

subgraph group_tools["Operator Tools"]
  node_cli["fastconfctl"]
  node_sidecar["fastconfd API"]
end

node_application(("Go Application"))
node_http_clients(("HTTP Clients"))

node_application -->|"creates manager"| node_manager
node_config_sources -->|"loads layers"| node_assembly
node_providers -->|"supplies inputs"| node_assembly
node_manager -.->|"assembles inputs"| node_assembly
node_assembly -.->|"scans files"| node_scan
node_assembly -.->|"stages layers"| node_merge
node_manager -->|"runs stages"| node_validation_policy
node_validation_policy -->|"runs transform"| node_transform
node_validation_policy -->|"runs typed hooks"| node_typed_hooks
node_validation_policy -->|"runs decode"| node_decode
node_validation_policy -->|"evaluates policy"| node_policy_extensions
node_manager -->|"publishes snapshot"| node_state
node_application -->|"reads snapshot"| node_state
node_manager -->|"starts watchers"| node_watching
node_manager -->|"retains history"| node_history
node_merge -.->|"records origins"| node_provenance
node_state -->|"explains fields"| node_provenance
node_manager -->|"notifies observers"| node_observers
node_manager -->|"notifies subscribers"| node_subscriptions
node_providers -.->|"fetches remote config"| node_http_clients
node_render -->|"renders provider data"| node_providers
node_metrics_tracing -.->|"observes reloads"| node_manager
node_cli -.->|"loads and inspects"| node_manager
node_sidecar -->|"serves snapshots"| node_manager
node_http_clients -->|"requests config"| node_sidecar
node_sidecar -->|"requests reload"| node_manager

click node_providers "https://github.com/fastabc/fastconf/tree/master/providers"
click node_assembly "https://github.com/fastabc/fastconf/blob/master/assemble.go"
click node_scan "https://github.com/fastabc/fastconf/blob/master/internal/scan/scan.go"
click node_merge "https://github.com/fastabc/fastconf/blob/master/commit.go"
click node_transform "https://github.com/fastabc/fastconf/tree/master/transform"
click node_typed_hooks "https://github.com/fastabc/fastconf/blob/master/codec/typed_hooks.go"
click node_decode "https://github.com/fastabc/fastconf/blob/master/decode.go"
click node_validation_policy "https://github.com/fastabc/fastconf/blob/master/pipeline.go"
click node_manager "https://github.com/fastabc/fastconf/blob/master/manager.go"
click node_state "https://github.com/fastabc/fastconf/blob/master/state.go"
click node_watching "https://github.com/fastabc/fastconf/blob/master/file_watch.go"
click node_history "https://github.com/fastabc/fastconf/blob/master/history.go"
click node_provenance "https://github.com/fastabc/fastconf/blob/master/internal/provenance/index.go"
click node_observers "https://github.com/fastabc/fastconf/blob/master/observe/observe.go"
click node_subscriptions "https://github.com/fastabc/fastconf/blob/master/subscribe.go"
click node_policy_extensions "https://github.com/fastabc/fastconf/tree/master/policy"
click node_render "https://github.com/fastabc/fastconf/blob/master/integrations/render/render.go"
click node_metrics_tracing "https://github.com/fastabc/fastconf/tree/master/observability"
click node_cli "https://github.com/fastabc/fastconf/tree/master/cmd/fastconfctl"
click node_sidecar "https://github.com/fastabc/fastconf/tree/master/cmd/fastconfd"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_config_sources,node_providers,node_http_clients toneBlue
class node_assembly,node_scan,node_merge,node_transform,node_typed_hooks,node_decode,node_validation_policy toneAmber
class node_manager,node_state,node_watching,node_history,node_provenance,node_observers,node_subscriptions toneMint
class node_policy_extensions,node_render,node_metrics_tracing toneRose
class node_cli,node_sidecar,node_application toneIndigo
```

## Components

### Inputs & Providers

- **Config Files**
- [Config Providers](https://github.com/fastabc/fastconf/tree/master/providers): `providers`

### Reload Pipeline

- [Input Assembly](https://github.com/fastabc/fastconf/blob/master/assemble.go): `assemble.go`
- [File Scanner](https://github.com/fastabc/fastconf/blob/master/internal/scan/scan.go): `internal/scan/scan.go`
- [Layer Merge](https://github.com/fastabc/fastconf/blob/master/commit.go): `commit.go`
- [Transforms & Secrets](https://github.com/fastabc/fastconf/tree/master/transform): `transform`
- [Typed Hooks](https://github.com/fastabc/fastconf/blob/master/codec/typed_hooks.go): `codec/typed_hooks.go`
- [Typed Decode](https://github.com/fastabc/fastconf/blob/master/decode.go): `decode.go`
- [Validation & Policy](https://github.com/fastabc/fastconf/blob/master/pipeline.go): `pipeline.go`

### Published Runtime

- [Manager & Reload](https://github.com/fastabc/fastconf/blob/master/manager.go): `manager.go`
- [Atomic State](https://github.com/fastabc/fastconf/blob/master/state.go): `state.go`
- [Change Watchers](https://github.com/fastabc/fastconf/blob/master/file_watch.go): `file_watch.go`
- [History & Rollback](https://github.com/fastabc/fastconf/blob/master/history.go): `history.go`
- [Origins & Explain](https://github.com/fastabc/fastconf/blob/master/internal/provenance/index.go): `internal/provenance/index.go`
- [Observers & Events](https://github.com/fastabc/fastconf/blob/master/observe/observe.go): `observe/observe.go`
- [Subscriptions](https://github.com/fastabc/fastconf/blob/master/subscribe.go): `subscribe.go`

### Extensions

- [Policy Engines](https://github.com/fastabc/fastconf/tree/master/policy): `policy`
- [Config Rendering](https://github.com/fastabc/fastconf/blob/master/integrations/render/render.go): `integrations/render/render.go`
- [Metrics & Tracing](https://github.com/fastabc/fastconf/tree/master/observability): `observability`

### Operator Tools

- [fastconfctl](https://github.com/fastabc/fastconf/tree/master/cmd/fastconfctl): `cmd/fastconfctl`
- [fastconfd API](https://github.com/fastabc/fastconf/tree/master/cmd/fastconfd): `cmd/fastconfd`

### Other components

- **Go Application**
- **HTTP Clients**

## Connections

- Go Application → Manager & Reload: creates manager (evidence: `README.md`)
- Config Files → Input Assembly: loads layers (evidence: `README.md`)
- Config Providers → Input Assembly: supplies inputs (evidence: `README.md`)
- Manager & Reload → Input Assembly: assembles inputs
- Input Assembly → File Scanner: scans files
- Input Assembly → Layer Merge: stages layers
- Manager & Reload → Validation & Policy: runs stages (evidence: `pipeline.go`)
- Validation & Policy → Transforms & Secrets: runs transform (evidence: `pipeline.go`)
- Validation & Policy → Typed Hooks: runs typed hooks (evidence: `pipeline.go`)
- Validation & Policy → Typed Decode: runs decode (evidence: `pipeline.go`)
- Validation & Policy → Policy Engines: evaluates policy (evidence: `pipeline.go`)
- Manager & Reload → Atomic State: publishes snapshot (evidence: `README.md`)
- Go Application → Atomic State: reads snapshot (evidence: `README.md`)
- Manager & Reload → Change Watchers: starts watchers (evidence: `manager.go`)
- Manager & Reload → History & Rollback: retains history (evidence: `README.md`)
- Layer Merge → Origins & Explain: records origins
- Atomic State → Origins & Explain: explains fields (evidence: `internal/provenance/index.go`)
- Manager & Reload → Observers & Events: notifies observers (evidence: `README.md`)
- Manager & Reload → Subscriptions: notifies subscribers (evidence: `README.md`)
- Config Providers → HTTP Clients: fetches remote config
- Config Rendering → Config Providers: renders provider data (evidence: `integrations/render/render.go`)
- Metrics & Tracing → Manager & Reload: observes reloads
- fastconfctl → Manager & Reload: loads and inspects
- fastconfd API → Manager & Reload: serves snapshots (evidence: `cmd/fastconfd/handlers.go`)
- HTTP Clients → fastconfd API: requests config (evidence: `cmd/fastconfd/main.go`)
- fastconfd API → Manager & Reload: requests reload (evidence: `cmd/fastconfd/handlers.go`)
