修复热点数据从文件系统转移到内存时可能不完整的Bug/实现部分Partial Content功能

This commit is contained in:
GoEdgeLab
2022-02-21 17:33:58 +08:00
parent 35e8b1a9ba
commit a6a44bf4d4
16 changed files with 704 additions and 87 deletions

View File

@@ -1,6 +1,7 @@
package caches
import (
"errors"
"github.com/cespare/xxhash"
"sync"
"time"
@@ -55,6 +56,13 @@ func (this *MemoryWriter) Write(data []byte) (n int, err error) {
return len(data), nil
}
// WriteAt 在指定位置写入数据
func (this *MemoryWriter) WriteAt(b []byte, offset int64) error {
_ = b
_ = offset
return errors.New("not supported")
}
// HeaderSize 数据尺寸
func (this *MemoryWriter) HeaderSize() int64 {
return this.headerSize