fscache:#golang的流式文件缓存
fscache
用法
#golang的流式文件缓存
fscache允许多个读取器在写入缓存时从缓存中读取。
直接使用缓存:
package main
import (
"io"
"log"
"os"
"time"
"gopkg.in/djherbis/fscache.v0"
)
func main () {
// create the cache, keys expire after 1 hour.
c , err := fscache . New ( "./cache" , 0755 , time . Hour )
if err != nil {
log . Fatal ( err . Error ())
}
// wipe the cache when done
defer c . Clean ()
// Get() and it's streams