|
- package vfs
-
- import (
- "path/filepath"
-
- "gitlink.org.cn/cloudream/storage/client2/internal/mount/config"
- "gitlink.org.cn/cloudream/storage/client2/internal/mount/fuse"
- "gitlink.org.cn/cloudream/storage/client2/internal/mount/vfs/cache"
- "gitlink.org.cn/cloudream/storage/common/pkgs/db2"
- "gitlink.org.cn/cloudream/storage/common/pkgs/downloader"
- )
-
- type Vfs struct {
- db *db2.DB
- config *config.Config
- cache *cache.Cache
- }
-
- func NewVfs(cfg *config.Config, db *db2.DB, downloader *downloader.Downloader) *Vfs {
- return &Vfs{
- db: db,
- config: cfg,
- cache: cache.NewCache(db, downloader, filepath.Join(cfg.CacheDir, "data"), filepath.Join(cfg.CacheDir, "meta")),
- }
- }
-
- func (v *Vfs) Root() fuse.FsDir {
- return newRoot(v)
- }
-
- func (v *Vfs) Stats() fuse.FsStats {
- return fuse.FsStats{}
- }
|