(path string)
| 156 | } |
| 157 | |
| 158 | func diskCache(path string) *diskcache.Cache { |
| 159 | d := diskv.New(diskv.Options{ |
| 160 | BasePath: path, |
| 161 | |
| 162 | // For file "c0ffee", store file as "c0/ff/c0ffee" |
| 163 | Transform: func(s string) []string { return []string{s[0:2], s[2:4]} }, |
| 164 | }) |
| 165 | return diskcache.NewWithDiskv(d) |
| 166 | } |