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.

execute.go 883 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package spacesyncer
  2. import (
  3. "gitlink.org.cn/cloudream/common/pkgs/trie"
  4. "gitlink.org.cn/cloudream/jcs-pub/client/types"
  5. stgtypes "gitlink.org.cn/cloudream/jcs-pub/common/pkgs/storage/types"
  6. )
  7. func execute(syncer *SpaceSyncer, task *task) {
  8. switch mode := task.Task.Mode.(type) {
  9. case *types.SpaceSyncModeFull:
  10. executeFull(syncer, task)
  11. case *types.SpaceSyncModeDiff:
  12. executeDiff(syncer, task, mode)
  13. }
  14. }
  15. func createDirNode(tree *trie.Trie[*stgtypes.DirEntry], pathComps []string, e *stgtypes.DirEntry) {
  16. var ptr = &tree.Root
  17. for _, c := range pathComps {
  18. ptr.Value = nil
  19. ptr = ptr.Create(c)
  20. }
  21. ptr.Value = e
  22. }
  23. func removeDirNode(tree *trie.Trie[*stgtypes.DirEntry], pathComps []string) {
  24. var ptr = &tree.Root
  25. for _, c := range pathComps {
  26. ptr.Value = nil
  27. next := ptr.WalkNext(c)
  28. if next == nil {
  29. break
  30. }
  31. }
  32. ptr.Value = nil
  33. ptr.RemoveSelf(true)
  34. }

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