优化部分代码

This commit is contained in:
dragon
2025-01-09 17:27:06 +08:00
parent f0c8fa5547
commit 2f7fa13240
10 changed files with 229 additions and 157 deletions

View File

@@ -17,6 +17,14 @@ type CacheContent struct {
LastModified time.Time
}
func (c *CacheContent) ReadToString() (string, error) {
all, err := io.ReadAll(c)
if err != nil {
return "", err
}
return string(all), nil
}
type Cache interface {
Put(key string, reader io.Reader) error
// Get return CacheContent or nil when put nil io.reader