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 904 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package vfs
  2. import (
  3. "gitlink.org.cn/cloudream/storage2/client2/internal/mount/config"
  4. "gitlink.org.cn/cloudream/storage2/client2/internal/mount/fuse"
  5. "gitlink.org.cn/cloudream/storage2/client2/internal/mount/vfs/cache"
  6. "gitlink.org.cn/cloudream/storage2/common/pkgs/db2"
  7. "gitlink.org.cn/cloudream/storage2/common/pkgs/downloader"
  8. "gitlink.org.cn/cloudream/storage2/common/pkgs/uploader"
  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, uploader *uploader.Uploader, downloader *downloader.Downloader) *Vfs {
  16. return &Vfs{
  17. db: db,
  18. config: cfg,
  19. cache: cache.NewCache(cfg, db, uploader, downloader),
  20. }
  21. }
  22. func (v *Vfs) Start() {
  23. v.cache.Start()
  24. }
  25. func (v *Vfs) Stop() {
  26. v.cache.Stop()
  27. }
  28. func (v *Vfs) Root() fuse.FsDir {
  29. return newRoot(v)
  30. }
  31. func (v *Vfs) Stats() fuse.FsStats {
  32. return fuse.FsStats{}
  33. }

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