You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

release.go 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright 2019 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package migration
  4. import (
  5. "io"
  6. "time"
  7. )
  8. // ReleaseAsset represents a release asset
  9. type ReleaseAsset struct {
  10. ID int64
  11. Name string
  12. ContentType *string `yaml:"content_type"`
  13. Size *int
  14. DownloadCount *int `yaml:"download_count"`
  15. Created time.Time
  16. Updated time.Time
  17. DownloadURL *string `yaml:"download_url"` // SECURITY: It is the responsibility of downloader to make sure this is safe
  18. // if DownloadURL is nil, the function should be invoked
  19. DownloadFunc func() (io.ReadCloser, error) `yaml:"-"` // SECURITY: It is the responsibility of downloader to make sure this is safe
  20. }
  21. // Release represents a release
  22. type Release struct {
  23. TagName string `yaml:"tag_name"` // SECURITY: This must pass git.IsValidRefPattern
  24. TargetCommitish string `yaml:"target_commitish"` // SECURITY: This must pass git.IsValidRefPattern
  25. Name string
  26. Body string
  27. Draft bool
  28. Prerelease bool
  29. PublisherID int64 `yaml:"publisher_id"`
  30. PublisherName string `yaml:"publisher_name"`
  31. PublisherEmail string `yaml:"publisher_email"`
  32. Assets []*ReleaseAsset
  33. Created time.Time
  34. Published time.Time
  35. }
  36. // GetExternalName ExternalUserMigrated interface
  37. func (r *Release) GetExternalName() string { return r.PublisherName }
  38. // GetExternalID ExternalUserMigrated interface
  39. func (r *Release) GetExternalID() int64 { return r.PublisherID }