ghorg/vendor/github.com/ktrysmt/go-bitbucket/downloads.go
2020-07-11 09:54:34 -07:00

16 lines
485 B
Go

package bitbucket
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)
return dl.c.executeFileUpload("POST", urlStr, do.FilePath, do.FileName)
}
func (dl *Downloads) List(do *DownloadsOptions) (interface{}, error) {
urlStr := dl.c.requestUrl("/repositories/%s/%s/downloads", do.Owner, do.RepoSlug)
return dl.c.execute("GET", urlStr, "")
}