add storage service
Some checks failed
CI / test-build (push) Failing after 2m4s

This commit is contained in:
2025-12-15 00:01:05 +07:00
parent 54e76d9304
commit 7c33e736f9
6 changed files with 768 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ import (
"gitea.avt.data-center.id/othman.suseno/atlas/internal/auth"
"gitea.avt.data-center.id/othman.suseno/atlas/internal/db"
"gitea.avt.data-center.id/othman.suseno/atlas/internal/job"
"gitea.avt.data-center.id/othman.suseno/atlas/internal/services"
"gitea.avt.data-center.id/othman.suseno/atlas/internal/snapshot"
"gitea.avt.data-center.id/othman.suseno/atlas/internal/storage"
"gitea.avt.data-center.id/othman.suseno/atlas/internal/zfs"
@@ -39,6 +40,9 @@ type App struct {
nfsStore *storage.NFSStore
iscsiStore *storage.ISCSIStore
database *db.DB // Optional database connection
smbService *services.SMBService
nfsService *services.NFSService
iscsiService *services.ISCSIService
}
func New(cfg Config) (*App, error) {
@@ -82,6 +86,11 @@ func New(cfg Config) (*App, error) {
nfsStore := storage.NewNFSStore()
iscsiStore := storage.NewISCSIStore()
// Initialize service daemon integrations
smbService := services.NewSMBService()
nfsService := services.NewNFSService()
iscsiService := services.NewISCSIService()
a := &App{
cfg: cfg,
tmpl: tmpl,
@@ -97,6 +106,9 @@ func New(cfg Config) (*App, error) {
nfsStore: nfsStore,
iscsiStore: iscsiStore,
database: database,
smbService: smbService,
nfsService: nfsService,
iscsiService: iscsiService,
}
// Start snapshot scheduler (runs every 15 minutes)