still working
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user