1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-08-01 17:38:33 +00:00

Count downloads for tag archives

This commit is contained in:
JakobDev 2024-04-02 16:34:57 +02:00
parent f8a5d6872c
commit 613e5387c5
22 changed files with 469 additions and 95 deletions

View file

@ -24,9 +24,10 @@ type Release struct {
// swagger:strfmt date-time
CreatedAt time.Time `json:"created_at"`
// swagger:strfmt date-time
PublishedAt time.Time `json:"published_at"`
Publisher *User `json:"author"`
Attachments []*Attachment `json:"assets"`
PublishedAt time.Time `json:"published_at"`
Publisher *User `json:"author"`
Attachments []*Attachment `json:"assets"`
ArchiveDownloadCount *TagArchiveDownloadCount `json:"archive_download_count"`
}
// CreateReleaseOption options when creating a release

View file

@ -5,23 +5,25 @@ package structs
// Tag represents a repository tag
type Tag struct {
Name string `json:"name"`
Message string `json:"message"`
ID string `json:"id"`
Commit *CommitMeta `json:"commit"`
ZipballURL string `json:"zipball_url"`
TarballURL string `json:"tarball_url"`
Name string `json:"name"`
Message string `json:"message"`
ID string `json:"id"`
Commit *CommitMeta `json:"commit"`
ZipballURL string `json:"zipball_url"`
TarballURL string `json:"tarball_url"`
ArchiveDownloadCount *TagArchiveDownloadCount `json:"archive_download_count"`
}
// AnnotatedTag represents an annotated tag
type AnnotatedTag struct {
Tag string `json:"tag"`
SHA string `json:"sha"`
URL string `json:"url"`
Message string `json:"message"`
Tagger *CommitUser `json:"tagger"`
Object *AnnotatedTagObject `json:"object"`
Verification *PayloadCommitVerification `json:"verification"`
Tag string `json:"tag"`
SHA string `json:"sha"`
URL string `json:"url"`
Message string `json:"message"`
Tagger *CommitUser `json:"tagger"`
Object *AnnotatedTagObject `json:"object"`
Verification *PayloadCommitVerification `json:"verification"`
ArchiveDownloadCount *TagArchiveDownloadCount `json:"archive_download_count"`
}
// AnnotatedTagObject contains meta information of the tag object
@ -38,3 +40,9 @@ type CreateTagOption struct {
Message string `json:"message"`
Target string `json:"target"`
}
// TagArchiveDownloadCount counts how many times a archive was downloaded
type TagArchiveDownloadCount struct {
Zip int64 `json:"zip"`
TarGz int64 `json:"tar_gz"`
}