factory

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

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.

Jump to

Keyboard shortcuts

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