2019-05-07 01:12:51 +00:00
|
|
|
// 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.
|
|
|
|
|
2021-11-16 15:25:33 +00:00
|
|
|
package migration
|
2019-05-07 01:12:51 +00:00
|
|
|
|
2020-12-27 03:34:19 +00:00
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
"time"
|
|
|
|
)
|
2019-05-07 01:12:51 +00:00
|
|
|
|
|
|
|
// ReleaseAsset represents a release asset
|
|
|
|
type ReleaseAsset struct {
|
2020-08-28 01:36:37 +00:00
|
|
|
ID int64
|
2019-05-07 01:12:51 +00:00
|
|
|
Name string
|
2020-12-27 03:34:19 +00:00
|
|
|
ContentType *string `yaml:"content_type"`
|
2019-05-07 01:12:51 +00:00
|
|
|
Size *int
|
2020-12-27 03:34:19 +00:00
|
|
|
DownloadCount *int `yaml:"download_count"`
|
2019-05-07 01:12:51 +00:00
|
|
|
Created time.Time
|
|
|
|
Updated time.Time
|
2020-12-27 03:34:19 +00:00
|
|
|
DownloadURL *string `yaml:"download_url"`
|
|
|
|
// if DownloadURL is nil, the function should be invoked
|
|
|
|
DownloadFunc func() (io.ReadCloser, error) `yaml:"-"`
|
2019-05-07 01:12:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Release represents a release
|
|
|
|
type Release struct {
|
2020-12-27 03:34:19 +00:00
|
|
|
TagName string `yaml:"tag_name"`
|
|
|
|
TargetCommitish string `yaml:"target_commitish"`
|
2019-05-07 01:12:51 +00:00
|
|
|
Name string
|
|
|
|
Body string
|
|
|
|
Draft bool
|
|
|
|
Prerelease bool
|
2020-12-27 03:34:19 +00:00
|
|
|
PublisherID int64 `yaml:"publisher_id"`
|
|
|
|
PublisherName string `yaml:"publisher_name"`
|
|
|
|
PublisherEmail string `yaml:"publisher_email"`
|
|
|
|
Assets []*ReleaseAsset
|
2019-05-07 01:12:51 +00:00
|
|
|
Created time.Time
|
|
|
|
Published time.Time
|
|
|
|
}
|