Chunk manager init

This commit is contained in:
Ben Sarmiento
2023-11-06 01:22:56 +01:00
parent 90aaceec77
commit a39c72523d
5 changed files with 31 additions and 74 deletions

View File

@@ -8,12 +8,13 @@ import (
"bazil.org/fuse/fs"
"github.com/debridmediamanager.com/zurg/internal/config"
"github.com/debridmediamanager.com/zurg/internal/torrent"
"github.com/debridmediamanager.com/zurg/pkg/chunk"
"github.com/debridmediamanager.com/zurg/pkg/logutil"
"golang.org/x/sys/unix"
)
func Mount(mountpoint string, c config.ConfigInterface, t *torrent.TorrentManager) error {
func Mount(mountpoint string, cfg config.ConfigInterface, tMgr *torrent.TorrentManager, cMgr *chunk.Manager) error {
rlog := logutil.NewLogger()
log := rlog.Named("zfs")
@@ -36,10 +37,11 @@ func Mount(mountpoint string, c config.ConfigInterface, t *torrent.TorrentManage
uid: uint32(unix.Geteuid()),
gid: uint32(unix.Getegid()),
umask: os.FileMode(0),
c: c,
t: t,
c: cfg,
t: tMgr,
log: log,
initTime: time.Now(),
chunk: cMgr,
}
if err := srv.Serve(filesys); err != nil {