Skip to content
This repository was archived by the owner on Jun 8, 2019. It is now read-only.

Commit 1b65852

Browse files
lunnytechknowlogick
authored andcommitted
add structs for list tags (#139)
1 parent 8503974 commit 1b65852

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

gitea/repo_tag.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright 2019 The Gitea Authors. All rights reserved.
2+
// Use of this source code is governed by a MIT-style
3+
// license that can be found in the LICENSE file.
4+
5+
package gitea
6+
7+
import (
8+
"fmt"
9+
)
10+
11+
// Tag represents a repository tag
12+
type Tag struct {
13+
Name string `json:"name"`
14+
Commit struct {
15+
SHA string `json:"sha"`
16+
URL string `json:"url"`
17+
} `json:"commit"`
18+
ZipballURL string `json:"zipball_url"`
19+
TarballURL string `json:"tarball_url"`
20+
}
21+
22+
// ListRepoTags list all the branches of one repository
23+
func (c *Client) ListRepoTags(user, repo string) ([]*Tag, error) {
24+
tags := make([]*Tag, 0, 10)
25+
return tags, c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/tags", user, repo), nil, nil, &tags)
26+
}

0 commit comments

Comments
 (0)