(key string)
| 33 | } |
| 34 | |
| 35 | func (c RunLogCache) Exists(key string) (bool, error) { |
| 36 | _, err := os.Stat(c.filepath(key)) |
| 37 | if err == nil { |
| 38 | return true, nil |
| 39 | } |
| 40 | |
| 41 | if errors.Is(err, os.ErrNotExist) { |
| 42 | return false, nil |
| 43 | } |
| 44 | |
| 45 | return false, fmt.Errorf("checking cache entry: %v", err) |
| 46 | } |
| 47 | |
| 48 | func (c RunLogCache) Create(key string, content io.Reader) error { |
| 49 | if err := os.MkdirAll(c.cacheDir, 0755); err != nil { |