Skip to content

feat: add external plugin backend via go-plugin#628

Open
maelanjais wants to merge 1 commit into
abtreece:mainfrom
maelanjais:feat/plugin-backend
Open

feat: add external plugin backend via go-plugin#628
maelanjais wants to merge 1 commit into
abtreece:mainfrom
maelanjais:feat/plugin-backend

Conversation

@maelanjais
Copy link
Copy Markdown

Splits the PostgreSQL half out of #621 as requested, so it can be assessed independently.
Add a plugin backend that loads any custom backend at runtime as a standalone binary, using HashiCorp go-plugin. Operators can extend confd with new sources without recompiling it.

  • pkg/backends/plugin/api: shared RPC DTOs, the BackendProvider interface, BackendRPCClient/BackendRPCServer, and the ConfdBackendPlugin boilerplate.
  • pkg/backends/plugin: a StoreClient that launches the external binary and proxies GetValues/WatchPrefix/HealthCheck/Close over RPC.
  • New confd plugin --plugin-path subcommand plus a plugin_path field in confd.toml. Registered in pkg/backends/client.go and pkg/backends/config.go.

A self-contained reference plugin ships as cmd/confd-plugin-postgres: it implements the SDK against PostgreSQL (with LISTEN/NOTIFY) without depending on any confd internals, so it doubles as a copy-paste starting point for plugin authors.

Includes RPC server/client unit tests (in-process mock), the SDK specification in PLUGIN_ARCHITECTURE.md, and an end-to-end walkthrough in PLUGIN_DEMO.md.

Add a `plugin` backend that loads any custom backend at runtime as a
standalone binary, using HashiCorp go-plugin. Operators can extend confd
with new sources without recompiling it.

- pkg/backends/plugin/api: shared RPC DTOs, the BackendProvider
  interface, BackendRPCClient/BackendRPCServer, and the
  ConfdBackendPlugin boilerplate.
- pkg/backends/plugin: a StoreClient that launches the external binary
  and proxies GetValues/WatchPrefix/HealthCheck/Close over RPC.
- New `confd plugin --plugin-path` subcommand plus a `plugin_path` field
  in confd.toml. Registered in pkg/backends/client.go and
  pkg/backends/config.go.

A self-contained reference plugin ships as cmd/confd-plugin-postgres: it
implements the SDK against PostgreSQL (with LISTEN/NOTIFY) without
depending on any confd internals, so it doubles as a copy-paste starting
point for plugin authors.

Includes RPC server/client unit tests (in-process mock), the SDK
specification in PLUGIN_ARCHITECTURE.md, and an end-to-end walkthrough in
PLUGIN_DEMO.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant