feat: complete OCI registry implementation with docker push/pull support
A lightweight OCI (Open Container Initiative) registry implementation written in Go.
This commit is contained in:
27
pkg/database/db/init.go
Normal file
27
pkg/database/db/init.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package db
|
||||
|
||||
import (
|
||||
"context"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/glebarez/sqlite"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
var (
|
||||
Default *gorm.DB
|
||||
)
|
||||
|
||||
func Init(ctx context.Context, dataDir string) error {
|
||||
var (
|
||||
err error
|
||||
dbPath = filepath.Join(dataDir, "cluster.db")
|
||||
)
|
||||
|
||||
Default, err = gorm.Open(sqlite.Open(dbPath), &gorm.Config{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user