go:generate moq -rm -out client_mock.go . ArtifactClient ArtifactClient is how the artifact commands reach the API. Every request goes to the host of the repository it is given.
| 20 | // ArtifactClient is how the artifact commands reach the API. Every request |
| 21 | // goes to the host of the repository it is given. |
| 22 | type ArtifactClient interface { |
| 23 | // IsPullRequest reports whether number in repo is a pull request rather |
| 24 | // than an issue, with one lookup. |
| 25 | IsPullRequest(repo ghrepo.Interface, number int) (bool, error) |
| 26 | // UploadTarget is IsPullRequest for a command that uploads files with |
| 27 | // --attach. Its one lookup also returns what an upload needs to know |
| 28 | // about repo. |
| 29 | UploadTarget(repo ghrepo.Interface, number int) (*UploadTarget, error) |
| 30 | // List returns the artifacts on an issue in the order the API returns |
| 31 | // them, which is number order. An empty artifactType lists every type, |
| 32 | // and a limit of 0 lists every artifact. |
| 33 | List(repo ghrepo.Interface, issueNumber int, artifactType string, limit int) ([]Artifact, error) |
| 34 | // Get returns one artifact on an issue, with its edit history. |
| 35 | Get(repo ghrepo.Interface, issueNumber int, number int) (*ArtifactWithVersions, error) |
| 36 | // Delete deletes one artifact from an issue. The API can't restore a |
| 37 | // deleted artifact. |
| 38 | Delete(repo ghrepo.Interface, issueNumber int, number int) error |
| 39 | // Create creates one artifact on an issue and returns it. The API doesn't |
| 40 | // return a new artifact's description. |
| 41 | Create(repo ghrepo.Interface, issueNumber int, artifactType, name, body string) (*Artifact, error) |
| 42 | // Update saves a new version of one artifact on an issue and returns the |
| 43 | // artifact. A nil name or body keeps the current one. The API can't change |
| 44 | // an artifact's type. |
| 45 | Update(repo ghrepo.Interface, issueNumber int, number int, name, body *string) (*Artifact, error) |
| 46 | } |
| 47 | |
| 48 | // maxPageSize is the most artifacts one request asks for. |
| 49 | const maxPageSize = 100 |
no outgoing calls
no test coverage detected