| 1 | // SPDX-License-Identifier: AGPL-3.0-or-later |
| 2 | |
| 3 | package storage |
| 4 | |
| 5 | import "errors" |
| 6 | |
| 7 | var ( |
| 8 | // ErrNotFound is returned by Get/Stat for absent keys and by reposfs |
| 9 | // helpers when a path doesn't exist. |
| 10 | ErrNotFound = errors.New("storage: not found") |
| 11 | |
| 12 | // ErrPreconditionFailed is returned by Put when an If-None-Match check fails. |
| 13 | ErrPreconditionFailed = errors.New("storage: precondition failed") |
| 14 | |
| 15 | // ErrInvalidPath is returned by RepoPath (and any helper that takes |
| 16 | // owner/repo names) for inputs that violate the whitelist. |
| 17 | ErrInvalidPath = errors.New("storage: invalid path") |
| 18 | |
| 19 | // ErrAlreadyExists is returned by Move and InitBare when the destination |
| 20 | // is already populated. Lets callers distinguish a race from corruption. |
| 21 | ErrAlreadyExists = errors.New("storage: already exists") |
| 22 | |
| 23 | // ErrEscapesRoot is returned by Delete and Move when a path resolves |
| 24 | // outside the configured storage root. Hard fail — never silently ignore. |
| 25 | ErrEscapesRoot = errors.New("storage: path escapes root") |
| 26 | ) |
| 27 |