mirror of
https://github.com/project-zot/zot.git
synced 2024-12-23 22:27:35 -05:00
f75bce3085
UI can now make use of OCI artifacts and references using `Referrers` gQL query. It returns a list of descriptors that refer on their `subject` field to another digest. Signed-off-by: Alex Stan <alexandrustan96@yahoo.ro>
86 lines
2.8 KiB
Go
86 lines
2.8 KiB
Go
package common
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type RepoInfo struct {
|
|
Summary RepoSummary
|
|
ImageSummaries []ImageSummary `json:"images"`
|
|
}
|
|
|
|
type RepoSummary struct {
|
|
Name string `json:"name"`
|
|
LastUpdated time.Time `json:"lastUpdated"`
|
|
Size string `json:"size"`
|
|
Platforms []OsArch `json:"platforms"`
|
|
Vendors []string `json:"vendors"`
|
|
Score int `json:"score"`
|
|
NewestImage ImageSummary `json:"newestImage"`
|
|
}
|
|
|
|
type ImageSummary struct {
|
|
RepoName string `json:"repoName"`
|
|
Tag string `json:"tag"`
|
|
Digest string `json:"digest"`
|
|
ConfigDigest string `json:"configDigest"`
|
|
LastUpdated time.Time `json:"lastUpdated"`
|
|
IsSigned bool `json:"isSigned"`
|
|
Size string `json:"size"`
|
|
Platform OsArch `json:"platform"`
|
|
Vendor string `json:"vendor"`
|
|
Score int `json:"score"`
|
|
DownloadCount int `json:"downloadCount"`
|
|
Description string `json:"description"`
|
|
Licenses string `json:"licenses"`
|
|
Labels string `json:"labels"`
|
|
Title string `json:"title"`
|
|
Source string `json:"source"`
|
|
Documentation string `json:"documentation"`
|
|
History []LayerHistory `json:"history"`
|
|
Layers []LayerSummary `json:"layers"`
|
|
Vulnerabilities ImageVulnerabilitySummary `json:"vulnerabilities"`
|
|
Authors string `json:"authors"`
|
|
}
|
|
|
|
type OsArch struct {
|
|
Os string `json:"os"`
|
|
Arch string `json:"arch"`
|
|
}
|
|
|
|
type ImageVulnerabilitySummary struct {
|
|
MaxSeverity string `json:"maxSeverity"`
|
|
Count int `json:"count"`
|
|
}
|
|
|
|
type LayerSummary struct {
|
|
Size string `json:"size"`
|
|
Digest string `json:"digest"`
|
|
Score int `json:"score"`
|
|
}
|
|
|
|
type LayerHistory struct {
|
|
Layer LayerSummary `json:"layer"`
|
|
HistoryDescription HistoryDescription `json:"historyDescription"`
|
|
}
|
|
|
|
type HistoryDescription struct {
|
|
Created time.Time `json:"created"`
|
|
CreatedBy string `json:"createdBy"`
|
|
Author string `json:"author"`
|
|
Comment string `json:"comment"`
|
|
EmptyLayer bool `json:"emptyLayer"`
|
|
}
|
|
|
|
type Referrer struct {
|
|
MediaType string `json:"mediatype"`
|
|
ArtifactType string `json:"artifacttype"`
|
|
Size int `json:"size"`
|
|
Digest string `json:"digest"`
|
|
Annotations []Annotation `json:"annotations"`
|
|
}
|
|
|
|
type Annotation struct {
|
|
Key string `json:"key"`
|
|
Value string `json:"value"`
|
|
}
|