688ee1978e
All checks were successful
continuous-integration/drone/push Build is passing
Add Docs on how to deal with this breaking change doResponse should return responce in all cases, to prosses things manualy if wanted helper func return http response Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: #416 Reviewed-by: Andrew Thornton <art27@cantab.net> Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
32 lines
948 B
Go
32 lines
948 B
Go
// Copyright 2019 The Gitea Authors. All rights reserved.
|
|
// Use of this source code is governed by a MIT-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package gitea
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
// Tag represents a repository tag
|
|
type Tag struct {
|
|
Name string `json:"name"`
|
|
ID string `json:"id"`
|
|
Commit *CommitMeta `json:"commit"`
|
|
ZipballURL string `json:"zipball_url"`
|
|
TarballURL string `json:"tarball_url"`
|
|
}
|
|
|
|
// ListRepoTagsOptions options for listing a repository's tags
|
|
type ListRepoTagsOptions struct {
|
|
ListOptions
|
|
}
|
|
|
|
// ListRepoTags list all the branches of one repository
|
|
func (c *Client) ListRepoTags(user, repo string, opt ListRepoTagsOptions) ([]*Tag, *Response, error) {
|
|
opt.setDefaults()
|
|
tags := make([]*Tag, 0, opt.PageSize)
|
|
resp, err := c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/tags?%s", user, repo, opt.getURLQuery().Encode()), nil, nil, &tags)
|
|
return tags, resp, err
|
|
}
|