still working

This commit is contained in:
Dev
2025-12-13 15:31:52 +00:00
parent dda7abedb7
commit d69e01bbaf
18 changed files with 795 additions and 1 deletions

View File

@@ -10,9 +10,13 @@ import (
"syscall"
"time"
"github.com/example/storage-appliance/internal/audit"
httpin "github.com/example/storage-appliance/internal/http"
"github.com/example/storage-appliance/internal/infra/osexec"
"github.com/example/storage-appliance/internal/infra/sqlite/db"
"github.com/example/storage-appliance/internal/infra/zfs"
"github.com/example/storage-appliance/internal/service/mock"
"github.com/example/storage-appliance/internal/service/storage"
_ "github.com/glebarez/sqlite"
"github.com/go-chi/chi/v5"
"github.com/google/uuid"
@@ -49,6 +53,10 @@ func main() {
diskSvc := &mock.MockDiskService{}
zfsSvc := &mock.MockZFSService{}
jobRunner := &mock.MockJobRunner{}
auditLogger := audit.NewSQLAuditLogger(sqldb)
zfsAdapter := zfs.NewAdapter(osexec.Default)
// storage service wiring: use zfsAdapter and jobRunner and audit logger
storageSvc := storage.NewStorageService(zfsAdapter, jobRunner, auditLogger)
app := &httpin.App{
DB: sqldb,
@@ -56,6 +64,7 @@ func main() {
ZFSSvc: zfsSvc,
JobRunner: jobRunner,
HTTPClient: &http.Client{},
StorageSvc: storageSvc,
}
r.Use(uuidMiddleware)
httpin.RegisterRoutes(r, app)