mirror of
https://lab.forgefriends.org/friendlyforgeformat/gof3.git
synced 2025-10-06 02:02:39 +02:00
41 lines
1.0 KiB
Go
41 lines
1.0 KiB
Go
// Copyright Earl Warren <contact@earl-warren.org>
|
|
// Copyright Loïc Dachary <loic@dachary.org>
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package f3
|
|
|
|
import (
|
|
"io"
|
|
"time"
|
|
)
|
|
|
|
type DownloadFuncType func() io.ReadCloser
|
|
|
|
type ReleaseAsset struct {
|
|
Common
|
|
Name string `json:"name"`
|
|
ContentType string `json:"content_type"`
|
|
Size int64 `json:"size"`
|
|
DownloadCount int64 `json:"download_count"`
|
|
Created time.Time `json:"created"`
|
|
SHA256 string `json:"sha256"`
|
|
DownloadURL string `json:"download_url"`
|
|
DownloadFunc DownloadFuncType `json:"-"`
|
|
}
|
|
|
|
func (o *ReleaseAsset) Clone() Interface {
|
|
clone := &ReleaseAsset{}
|
|
*clone = *o
|
|
return clone
|
|
}
|
|
|
|
func (o ReleaseAsset) GetCmpIgnoreFields() []string {
|
|
return append(o.Common.GetCmpIgnoreFields(), ".DownloadFunc", ".Created", ".DownloadCount", ".DownloadURL")
|
|
}
|
|
|
|
func (o ReleaseAsset) GetComparers() []Comparer {
|
|
return []Comparer{
|
|
func(DownloadFuncType, DownloadFuncType) bool { return true },
|
|
}
|
|
}
|