优化缓存管理

This commit is contained in:
GoEdgeLab
2021-01-13 12:02:50 +08:00
parent 0e51e1c7cb
commit ba6fa92dc9
22 changed files with 1517 additions and 548 deletions

View File

@@ -2,11 +2,17 @@ package caches
// 缓存内容写入接口
type Writer interface {
// 写入数据
// 写入Header数据
WriteHeader(data []byte) (n int, err error)
// 写入Body数据
Write(data []byte) (n int, err error)
// 写入的数据大小
Size() int64
// 写入的Header数据大小
HeaderSize() int64
// 写入的Body数据大小
BodySize() int64
// 关闭
Close() error