code.gitea.io/gitea@v1.19.3/modules/structs/release.go (about)

     1  // Copyright 2016 The Gitea Authors. All rights reserved.
     2  // SPDX-License-Identifier: MIT
     3  
     4  package structs
     5  
     6  import (
     7  	"time"
     8  )
     9  
    10  // Release represents a repository release
    11  type Release struct {
    12  	ID           int64  `json:"id"`
    13  	TagName      string `json:"tag_name"`
    14  	Target       string `json:"target_commitish"`
    15  	Title        string `json:"name"`
    16  	Note         string `json:"body"`
    17  	URL          string `json:"url"`
    18  	HTMLURL      string `json:"html_url"`
    19  	TarURL       string `json:"tarball_url"`
    20  	ZipURL       string `json:"zipball_url"`
    21  	IsDraft      bool   `json:"draft"`
    22  	IsPrerelease bool   `json:"prerelease"`
    23  	// swagger:strfmt date-time
    24  	CreatedAt time.Time `json:"created_at"`
    25  	// swagger:strfmt date-time
    26  	PublishedAt time.Time     `json:"published_at"`
    27  	Publisher   *User         `json:"author"`
    28  	Attachments []*Attachment `json:"assets"`
    29  }
    30  
    31  // CreateReleaseOption options when creating a release
    32  type CreateReleaseOption struct {
    33  	// required: true
    34  	TagName      string `json:"tag_name" binding:"Required"`
    35  	Target       string `json:"target_commitish"`
    36  	Title        string `json:"name"`
    37  	Note         string `json:"body"`
    38  	IsDraft      bool   `json:"draft"`
    39  	IsPrerelease bool   `json:"prerelease"`
    40  }
    41  
    42  // EditReleaseOption options when editing a release
    43  type EditReleaseOption struct {
    44  	TagName      string `json:"tag_name"`
    45  	Target       string `json:"target_commitish"`
    46  	Title        string `json:"name"`
    47  	Note         string `json:"body"`
    48  	IsDraft      *bool  `json:"draft"`
    49  	IsPrerelease *bool  `json:"prerelease"`
    50  }