(_ context.Context, key string, value []byte)
| 32 | } |
| 33 | |
| 34 | func (f *FileCache) Store(_ context.Context, key string, value []byte) error { |
| 35 | mu := f.getScopedLocks(key) |
| 36 | mu.Lock() |
| 37 | defer mu.Unlock() |
| 38 | |
| 39 | fileName := f.getFileName(key) |
| 40 | if err := f.fs.MkdirAll(filepath.Dir(fileName), 0700); err != nil { |
| 41 | return err |
| 42 | } |
| 43 | |
| 44 | if err := afero.WriteFile(f.fs, fileName, value, 0700); err != nil { |
| 45 | return err |
| 46 | } |
| 47 | |
| 48 | return nil |
| 49 | } |
| 50 | |
| 51 | func (f *FileCache) Load(_ context.Context, key string) (value []byte, exist bool, err error) { |
| 52 | r, ok, err := f.open(key) |
nothing calls this directly
no test coverage detected