Files
software-station/internal/models/models.go
Sudo-Ivan d8748bba77
All checks were successful
CI / build (push) Successful in 1m8s
renovate / renovate (push) Successful in 1m42s
Update asset caching and documentation features
- Updated the API server to support asset caching with a new flag for enabling/disabling caching.
- Implemented asset caching logic in the DownloadProxyHandler to store and retrieve assets efficiently.
- Added tests for asset caching functionality, ensuring proper behavior for cache hits and misses.
- Introduced new documentation files for software, including multi-language support.
- Enhanced the SoftwareCard component to display documentation links for software with available docs.
- Updated the Software model to include a flag indicating the presence of documentation.
- Improved the user interface for documentation navigation and search functionality.
2025-12-27 19:08:36 -06:00

56 lines
1.5 KiB
Go

package models
import "time"
type Asset struct {
Name string `json:"name"`
Size int64 `json:"size"`
URL string `json:"url"`
OS string `json:"os"`
SHA256 string `json:"sha256,omitempty"`
IsSBOM bool `json:"is_sbom"`
}
type Contributor struct {
Username string `json:"username"`
AvatarURL string `json:"avatar_url"`
GPGKeys []string `json:"gpg_keys,omitempty"`
}
type SourceSecurity struct {
Domain string `json:"domain"`
TLSValid bool `json:"tls_valid"`
}
type Release struct {
TagName string `json:"tag_name"`
Body string `json:"body,omitempty"`
CreatedAt time.Time `json:"created_at"`
Assets []Asset `json:"assets"`
Contributors []Contributor `json:"contributors,omitempty"`
Security *SourceSecurity `json:"security,omitempty"`
}
type Software struct {
Name string `json:"name"`
Owner string `json:"owner"`
Description string `json:"description"`
Releases []Release `json:"releases"`
GiteaURL string `json:"gitea_url"`
Topics []string `json:"topics"`
License string `json:"license,omitempty"`
IsPrivate bool `json:"is_private"`
AvatarURL string `json:"avatar_url,omitempty"`
HasDocs bool `json:"has_docs"`
}
type FingerprintData struct {
Known bool `json:"known"`
TotalBytes int64 `json:"total_bytes"`
}
type SoftwareResponse struct {
GiteaURL string `json:"gitea_url"`
Software []Software `json:"software"`
}