(entry fs.DirEntry)
| 9 | ) |
| 10 | |
| 11 | func ownsWALBlock(entry fs.DirEntry) bool { |
| 12 | // all new wal blocks are folders |
| 13 | if !entry.IsDir() { |
| 14 | return false |
| 15 | } |
| 16 | |
| 17 | // We own anything that parses and contains "preview" in the version |
| 18 | _, _, version, err := parseName(entry.Name()) |
| 19 | if err != nil { |
| 20 | return false |
| 21 | } |
| 22 | |
| 23 | return strings.Contains(version, "preview") |
| 24 | } |
| 25 | |
| 26 | func parseName(filename string) (uuid.UUID, string, string, error) { |
| 27 | splits := strings.Split(filename, "+") |
no test coverage detected