mirror of
https://github.com/gabrie30/ghorg.git
synced 2025-08-10 08:17:10 +02:00
Bumps [github.com/ktrysmt/go-bitbucket](https://github.com/ktrysmt/go-bitbucket) from 0.9.79 to 0.9.80. - [Release notes](https://github.com/ktrysmt/go-bitbucket/releases) - [Commits](https://github.com/ktrysmt/go-bitbucket/compare/v0.9.79...v0.9.80) --- updated-dependencies: - dependency-name: github.com/ktrysmt/go-bitbucket dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
28 lines
737 B
Go
28 lines
737 B
Go
package bitbucket
|
|
|
|
import "fmt"
|
|
|
|
type Downloads struct {
|
|
c *Client
|
|
}
|
|
|
|
func (dl *Downloads) Create(do *DownloadsOptions) (interface{}, error) {
|
|
urlStr := dl.c.requestUrl("/repositories/%s/%s/downloads", do.Owner, do.RepoSlug)
|
|
|
|
if do.FileName != "" {
|
|
if len(do.Files) > 0 {
|
|
return nil, fmt.Errorf("can't specify both files and filename")
|
|
}
|
|
do.Files = []File{{
|
|
Path: do.FileName,
|
|
Name: do.FileName,
|
|
}}
|
|
}
|
|
return dl.c.executeFileUpload("POST", urlStr, do.Files, []string{}, make(map[string]string), do.ctx)
|
|
}
|
|
|
|
func (dl *Downloads) List(do *DownloadsOptions) (interface{}, error) {
|
|
urlStr := dl.c.requestUrl("/repositories/%s/%s/downloads", do.Owner, do.RepoSlug)
|
|
return dl.c.executePaginated("GET", urlStr, "", nil)
|
|
}
|