mirror of
https://github.com/googleapis/genai-toolbox.git
synced 2026-01-10 07:58:12 -05:00
This commit refactors the source configuration and loading mechanism to use a dynamic registration pattern. Each source package now registers itself with a central registry via its init() function. The server configuration code uses this registry to decode and initialize sources, decoupling it from specific source implementations and simplifying the addition of new sources. Key changes: - Introduced `sources.Register()` and `newConfig()` constructor in each source package. - Moved source package imports to `cmd/root.go` as blank imports to trigger `init()` functions for self-registration. - Removed direct imports of specific source packages from `internal/server/config.go`. - Renamed `SourceKind` constants to `Kind` within each source package. - Updated tests to use the new `Kind` constants and reflect registration changes. --------- Co-authored-by: Yuan Teoh <yuanteoh@google.com>