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

add structs for list tags #139

Merged
merged 1 commit into from
Jan 26, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions gitea/repo_tag.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// 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"`
Commit struct {
SHA string `json:"sha"`
URL string `json:"url"`
} `json:"commit"`
ZipballURL string `json:"zipball_url"`
TarballURL string `json:"tarball_url"`
}

// ListRepoTags list all the branches of one repository
func (c *Client) ListRepoTags(user, repo string) ([]*Tag, error) {
tags := make([]*Tag, 0, 10)
return tags, c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/tags", user, repo), nil, nil, &tags)
}