You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

vfs.go 803 B

123456789101112131415161718192021222324252627282930313233
  1. package vfs
  2. import (
  3. "path/filepath"
  4. "gitlink.org.cn/cloudream/storage/client2/internal/mount/config"
  5. "gitlink.org.cn/cloudream/storage/client2/internal/mount/fuse"
  6. "gitlink.org.cn/cloudream/storage/client2/internal/mount/vfs/cache"
  7. "gitlink.org.cn/cloudream/storage/common/pkgs/db2"
  8. "gitlink.org.cn/cloudream/storage/common/pkgs/downloader"
  9. )
  10. type Vfs struct {
  11. db *db2.DB
  12. config *config.Config
  13. cache *cache.Cache
  14. }
  15. func NewVfs(cfg *config.Config, db *db2.DB, downloader *downloader.Downloader) *Vfs {
  16. return &Vfs{
  17. db: db,
  18. config: cfg,
  19. cache: cache.NewCache(db, downloader, filepath.Join(cfg.CacheDir, "data"), filepath.Join(cfg.CacheDir, "meta")),
  20. }
  21. }
  22. func (v *Vfs) Root() fuse.FsDir {
  23. return newRoot(v)
  24. }
  25. func (v *Vfs) Stats() fuse.FsStats {
  26. return fuse.FsStats{}
  27. }

本项目旨在将云际存储公共基础设施化,使个人及企业可低门槛使用高效的云际存储服务(安装开箱即用云际存储客户端即可,无需关注其他组件的部署),同时支持用户灵活便捷定制云际存储的功能细节。