|
12345678910111213141516171819202122232425262728293031323334353637 |
- package cache
-
- import (
- "io"
- "os"
-
- stgmod "gitlink.org.cn/cloudream/storage/common/models"
- )
-
- type LocalLoader struct {
- cache *CacheFile
- file *os.File
- offset int64
- // 当前正在加载的数据段。为nil表示没有加载任何数据。
- loading *FileSegment
- // 最多加载到哪个位置。-1代表无限制。
- limit int64
- }
-
- // 启动数据加载。通过设置seg的Position和Length来指定要加载的数据范围。
- func (l *LocalLoader) BeginLoading(seg *FileSegment) {
-
- }
-
- type RemoteLoader struct {
- cache *CacheFile
- object stgmod.ObjectDetail
- reader io.ReadCloser
- offset int64
- // 当前正在加载的数据段。为nil表示没有加载任何数据。
- loading *FileSegment
- // 最多加载到哪个位置。-1代表无限制。
- limit int64
- }
-
- func (l *RemoteLoader) BeginLoading(seg *FileSegment) {
- }
|