(key string)
| 43 | } |
| 44 | |
| 45 | func (dc *dirCache) Get(key string) ([]byte, bool) { |
| 46 | b, err := os.ReadFile(dc.path(key)) |
| 47 | return b, err == nil |
| 48 | } |
| 49 | |
| 50 | func (dc *dirCache) Put(key string, value []byte) error { |
| 51 | return os.WriteFile(dc.path(key), value, 0755) |