Files
gof3/f3/releaseasset.go
2023-12-28 10:43:13 +01:00

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 },
}
}