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
5package migration
6
7import (
8	"io"
9	"time"
10)
11
12// ReleaseAsset represents a release asset
13type ReleaseAsset struct {
14	ID            int64
15	Name          string
16	ContentType   *string `yaml:"content_type"`
17	Size          *int
18	DownloadCount *int `yaml:"download_count"`
19	Created       time.Time
20	Updated       time.Time
21	DownloadURL   *string `yaml:"download_url"`
22	// if DownloadURL is nil, the function should be invoked
23	DownloadFunc func() (io.ReadCloser, error) `yaml:"-"`
24}
25
26// Release represents a release
27type Release struct {
28	TagName         string `yaml:"tag_name"`
29	TargetCommitish string `yaml:"target_commitish"`
30	Name            string
31	Body            string
32	Draft           bool
33	Prerelease      bool
34	PublisherID     int64  `yaml:"publisher_id"`
35	PublisherName   string `yaml:"publisher_name"`
36	PublisherEmail  string `yaml:"publisher_email"`
37	Assets          []*ReleaseAsset
38	Created         time.Time
39	Published       time.Time
40}
41