(_ context.Context, key string)
| 49 | } |
| 50 | |
| 51 | func (f *FileCache) Load(_ context.Context, key string) (value []byte, exist bool, err error) { |
| 52 | r, ok, err := f.open(key) |
| 53 | if err != nil || !ok { |
| 54 | return nil, ok, err |
| 55 | } |
| 56 | defer r.Close() |
| 57 | |
| 58 | value, err = io.ReadAll(r) |
| 59 | if err != nil { |
| 60 | return nil, false, err |
| 61 | } |
| 62 | return value, true, nil |
| 63 | } |
| 64 | |
| 65 | func (f *FileCache) Delete(_ context.Context, key string) error { |
| 66 | mu := f.getScopedLocks(key) |