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.

data_loader.go 836 B

12345678910111213141516171819202122232425262728293031323334353637
  1. package cache
  2. import (
  3. "io"
  4. "os"
  5. stgmod "gitlink.org.cn/cloudream/storage/common/models"
  6. )
  7. type LocalLoader struct {
  8. cache *CacheFile
  9. file *os.File
  10. offset int64
  11. // 当前正在加载的数据段。为nil表示没有加载任何数据。
  12. loading *FileSegment
  13. // 最多加载到哪个位置。-1代表无限制。
  14. limit int64
  15. }
  16. // 启动数据加载。通过设置seg的Position和Length来指定要加载的数据范围。
  17. func (l *LocalLoader) BeginLoading(seg *FileSegment) {
  18. }
  19. type RemoteLoader struct {
  20. cache *CacheFile
  21. object stgmod.ObjectDetail
  22. reader io.ReadCloser
  23. offset int64
  24. // 当前正在加载的数据段。为nil表示没有加载任何数据。
  25. loading *FileSegment
  26. // 最多加载到哪个位置。-1代表无限制。
  27. limit int64
  28. }
  29. func (l *RemoteLoader) BeginLoading(seg *FileSegment) {
  30. }

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