Add registry validators (#350)

Fixes #96

## Motivation and Context

See #96

## How Has This Been Tested?

Has some unit and integration tests, still needs proper testing of the
different registry types

## Breaking Changes

Yes, new package uploads will need extra verification

## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [x] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
This commit is contained in:
adam jones 2025-09-04 22:45:59 +01:00 • committed by GitHub
commit 694a4d8879
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -47,7 +47,6 @@ func main() {
switch cfg.DatabaseType {
case config.DatabaseTypeMemory:
db = database.NewMemoryDB()
registryService = service.NewRegistryServiceWithDB(db)
case config.DatabaseTypePostgreSQL:
// Use PostgreSQL for real registry service
// Create a context with timeout for PostgreSQL connection
@ -61,10 +60,6 @@ func main() {
return
}
// Create registry service with PostgreSQL
registryService = service.NewRegistryServiceWithDB(db)
log.Printf("PostgreSQL database URL: %s", cfg.DatabaseURL)
// Store the PostgreSQL instance for later cleanup
defer func() {
if err := db.Close(); err != nil {
@ -78,6 +73,8 @@ func main() {
return
}
registryService = service.NewRegistryService(db, cfg)
// Import seed data if seed source is provided
if cfg.SeedFrom != "" {
log.Printf("Importing data from %s...", cfg.SeedFrom)