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