修复热点数据从文件系统转移到内存时可能不完整的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

@@ -2,6 +2,7 @@ package caches
import (
"encoding/binary"
"errors"
"github.com/iwind/TeaGo/types"
"io"
"os"
@@ -65,6 +66,13 @@ func (this *FileWriter) Write(data []byte) (n int, err error) {
return
}
// WriteAt 在指定位置写入数据
func (this *FileWriter) WriteAt(data []byte, offset int64) error {
_ = data
_ = offset
return errors.New("not supported")
}
// WriteBodyLength 写入Body长度数据
func (this *FileWriter) WriteBodyLength(bodyLength int64) error {
bytes8 := make([]byte, 8)