Documentation
¶
Overview ¶
Package factory provides factory functions for creating service implementations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRegistryService ¶
func NewRegistryService( ctx context.Context, cfg *config.Config, pool *pgxpool.Pool, provider inmemory.RegistryDataProvider, ) (service.RegistryService, error)
NewRegistryService creates a RegistryService based on the configured storage type.
For file-based storage, it returns an in-memory service that uses the provided RegistryDataProvider to read registry data from the filesystem.
For database storage, it creates and returns a database-backed service that stores registry data directly in PostgreSQL. The pool parameter must not be nil when database storage is configured.
Returns an error if database storage is configured but the pool is nil, or if file storage is configured but the provider is nil.
Types ¶
This section is empty.