Documentation
¶
Overview ¶
Package app provides application lifecycle management for the registry server.
Index ¶
- type AppComponents
- type RegistryApp
- type RegistryAppOptions
- func WithAddress(addr string) RegistryAppOptions
- func WithConfig(c *config.Config) RegistryAppOptions
- func WithDataDirectory(dir string) RegistryAppOptions
- func WithDeploymentProvider(provider service.DeploymentProvider) RegistryAppOptions
- func WithMiddlewares(mw ...func(http.Handler) http.Handler) RegistryAppOptions
- func WithRegistryProvider(provider service.RegistryDataProvider) RegistryAppOptions
- func WithSourceHandlerFactory(factory sources.SourceHandlerFactory) RegistryAppOptions
- func WithStatusPersistence(sp status.StatusPersistence) RegistryAppOptions
- func WithStorageManager(sm sources.StorageManager) RegistryAppOptions
- func WithSyncManager(sm pkgsync.Manager) RegistryAppOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppComponents ¶
type AppComponents struct {
// SyncCoordinator manages background synchronization
SyncCoordinator coordinator.Coordinator
// RegistryService provides registry business logic
RegistryService service.RegistryService
}
AppComponents groups all application components
type RegistryApp ¶
type RegistryApp struct {
// contains filtered or unexported fields
}
RegistryApp encapsulates all components needed to run the registry API server It provides lifecycle management and graceful shutdown capabilities
func NewRegistryApp ¶
func NewRegistryApp( ctx context.Context, opts ...RegistryAppOptions, ) (*RegistryApp, error)
NewRegistryApp creates a new builder with the given configuration
func (*RegistryApp) GetConfig ¶
func (app *RegistryApp) GetConfig() *config.Config
GetConfig returns the application configuration
func (*RegistryApp) GetHTTPServer ¶
func (app *RegistryApp) GetHTTPServer() *http.Server
GetHTTPServer returns the HTTP server (useful for testing to get the actual port)
func (*RegistryApp) Start ¶
func (app *RegistryApp) Start() error
Start starts the application components (HTTP server and background sync) This method blocks until the HTTP server stops or encounters an error
type RegistryAppOptions ¶
type RegistryAppOptions func(*registryAppConfig) error
RegistryAppOptions is a function that configures the registry app builder
func WithAddress ¶
func WithAddress(addr string) RegistryAppOptions
WithAddress sets the HTTP server address
func WithConfig ¶
func WithConfig(c *config.Config) RegistryAppOptions
WithConfig sets the configuration
func WithDataDirectory ¶
func WithDataDirectory(dir string) RegistryAppOptions
WithDataDirectory sets the data directory for storage and status files
func WithDeploymentProvider ¶
func WithDeploymentProvider(provider service.DeploymentProvider) RegistryAppOptions
WithDeploymentProvider allows injecting a custom deployment provider (for testing)
func WithMiddlewares ¶
func WithMiddlewares(mw ...func(http.Handler) http.Handler) RegistryAppOptions
WithMiddlewares sets custom HTTP middlewares
func WithRegistryProvider ¶
func WithRegistryProvider(provider service.RegistryDataProvider) RegistryAppOptions
WithRegistryProvider allows injecting a custom registry provider (for testing)
func WithSourceHandlerFactory ¶
func WithSourceHandlerFactory(factory sources.SourceHandlerFactory) RegistryAppOptions
WithSourceHandlerFactory allows injecting a custom source handler factory (for testing)
func WithStatusPersistence ¶
func WithStatusPersistence(sp status.StatusPersistence) RegistryAppOptions
WithStatusPersistence allows injecting custom status persistence (for testing)
func WithStorageManager ¶
func WithStorageManager(sm sources.StorageManager) RegistryAppOptions
WithStorageManager allows injecting a custom storage manager (for testing)
func WithSyncManager ¶
func WithSyncManager(sm pkgsync.Manager) RegistryAppOptions
WithSyncManager allows injecting a custom sync manager (for testing)