2020-06-26 14:09:10 -05:00
|
|
|
// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
|
|
|
|
|
2022-07-15 06:10:51 -05:00
|
|
|
package gql_generated
|
2020-06-26 14:09:10 -05:00
|
|
|
|
2020-08-19 01:53:04 -05:00
|
|
|
import (
|
2023-01-09 15:37:44 -05:00
|
|
|
"fmt"
|
|
|
|
"io"
|
|
|
|
"strconv"
|
2020-08-19 01:53:04 -05:00
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
2022-11-23 13:53:28 -05:00
|
|
|
type Annotation struct {
|
|
|
|
Key *string `json:"Key"`
|
|
|
|
Value *string `json:"Value"`
|
|
|
|
}
|
|
|
|
|
2022-10-05 14:56:41 -05:00
|
|
|
// Contains various details about the CVE and a list of PackageInfo about the affected packages
|
2020-06-26 14:09:10 -05:00
|
|
|
type Cve struct {
|
|
|
|
ID *string `json:"Id"`
|
|
|
|
Title *string `json:"Title"`
|
|
|
|
Description *string `json:"Description"`
|
|
|
|
Severity *string `json:"Severity"`
|
|
|
|
PackageList []*PackageInfo `json:"PackageList"`
|
|
|
|
}
|
|
|
|
|
2022-10-05 14:56:41 -05:00
|
|
|
// Contains the tag of the image and a list of CVEs
|
2020-06-26 14:09:10 -05:00
|
|
|
type CVEResultForImage struct {
|
|
|
|
Tag *string `json:"Tag"`
|
|
|
|
CVEList []*Cve `json:"CVEList"`
|
|
|
|
}
|
|
|
|
|
2023-01-09 15:37:44 -05:00
|
|
|
type Filter struct {
|
|
|
|
Os []*string `json:"Os"`
|
|
|
|
Arch []*string `json:"Arch"`
|
|
|
|
HasToBeSigned *bool `json:"HasToBeSigned"`
|
|
|
|
}
|
|
|
|
|
2022-10-05 14:56:41 -05:00
|
|
|
// Search everything. Can search Images, Repos and Layers
|
2022-07-12 07:58:04 -05:00
|
|
|
type GlobalSearchResult struct {
|
2023-01-09 15:37:44 -05:00
|
|
|
Page *PageInfo `json:"Page"`
|
2022-07-12 07:58:04 -05:00
|
|
|
Images []*ImageSummary `json:"Images"`
|
|
|
|
Repos []*RepoSummary `json:"Repos"`
|
|
|
|
Layers []*LayerSummary `json:"Layers"`
|
|
|
|
}
|
|
|
|
|
2022-09-21 12:53:56 -05:00
|
|
|
type HistoryDescription struct {
|
|
|
|
Created *time.Time `json:"Created"`
|
|
|
|
// CreatedBy is the command which created the layer.
|
|
|
|
CreatedBy *string `json:"CreatedBy"`
|
|
|
|
// Author is the author of the build point.
|
|
|
|
Author *string `json:"Author"`
|
|
|
|
// Comment is a custom message set when creating the layer.
|
|
|
|
Comment *string `json:"Comment"`
|
|
|
|
// EmptyLayer is used to mark if the history item created a filesystem diff.
|
|
|
|
EmptyLayer *bool `json:"EmptyLayer"`
|
|
|
|
}
|
|
|
|
|
2022-10-05 14:56:41 -05:00
|
|
|
// Contains details about the image
|
2022-07-12 07:58:04 -05:00
|
|
|
type ImageSummary struct {
|
2022-09-28 13:39:54 -05:00
|
|
|
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"`
|
|
|
|
Layers []*LayerSummary `json:"Layers"`
|
|
|
|
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"`
|
|
|
|
Vulnerabilities *ImageVulnerabilitySummary `json:"Vulnerabilities"`
|
2022-11-10 18:02:17 -05:00
|
|
|
Authors *string `json:"Authors"`
|
2022-09-28 13:39:54 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
type ImageVulnerabilitySummary struct {
|
|
|
|
MaxSeverity *string `json:"MaxSeverity"`
|
|
|
|
Count *int `json:"Count"`
|
2022-09-21 12:53:56 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
type LayerHistory struct {
|
|
|
|
Layer *LayerSummary `json:"Layer"`
|
|
|
|
HistoryDescription *HistoryDescription `json:"HistoryDescription"`
|
2022-02-01 21:02:05 -05:00
|
|
|
}
|
|
|
|
|
2022-10-05 14:56:41 -05:00
|
|
|
// Contains details about the layer
|
2022-07-12 07:58:04 -05:00
|
|
|
type LayerSummary struct {
|
|
|
|
Size *string `json:"Size"`
|
|
|
|
Digest *string `json:"Digest"`
|
|
|
|
Score *int `json:"Score"`
|
|
|
|
}
|
|
|
|
|
2022-10-05 14:56:41 -05:00
|
|
|
// Contains details about the supported OS and architecture of the image
|
2022-07-12 07:58:04 -05:00
|
|
|
type OsArch struct {
|
|
|
|
Os *string `json:"Os"`
|
|
|
|
Arch *string `json:"Arch"`
|
|
|
|
}
|
|
|
|
|
2022-10-05 14:56:41 -05:00
|
|
|
// Contains the name of the package, the current installed version and the version where the CVE was fixed
|
2020-06-26 14:09:10 -05:00
|
|
|
type PackageInfo struct {
|
|
|
|
Name *string `json:"Name"`
|
|
|
|
InstalledVersion *string `json:"InstalledVersion"`
|
|
|
|
FixedVersion *string `json:"FixedVersion"`
|
|
|
|
}
|
2020-08-19 01:53:04 -05:00
|
|
|
|
2023-01-09 15:37:44 -05:00
|
|
|
type PageInfo struct {
|
2023-01-18 17:20:55 -05:00
|
|
|
TotalCount int `json:"TotalCount"`
|
|
|
|
ItemCount int `json:"ItemCount"`
|
2023-01-09 15:37:44 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
type PageInput struct {
|
|
|
|
Limit *int `json:"limit"`
|
|
|
|
Offset *int `json:"offset"`
|
|
|
|
SortBy *SortCriteria `json:"sortBy"`
|
|
|
|
}
|
|
|
|
|
2023-01-18 17:20:55 -05:00
|
|
|
type PaginatedImagesResult struct {
|
|
|
|
Page *PageInfo `json:"Page"`
|
|
|
|
Results []*ImageSummary `json:"Results"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type PaginatedReposResult struct {
|
|
|
|
Page *PageInfo `json:"Page"`
|
|
|
|
Results []*RepoSummary `json:"Results"`
|
|
|
|
}
|
|
|
|
|
2022-11-23 13:53:28 -05:00
|
|
|
type Referrer struct {
|
|
|
|
MediaType *string `json:"MediaType"`
|
|
|
|
ArtifactType *string `json:"ArtifactType"`
|
|
|
|
Size *int `json:"Size"`
|
|
|
|
Digest *string `json:"Digest"`
|
|
|
|
Annotations []*Annotation `json:"Annotations"`
|
|
|
|
}
|
|
|
|
|
2022-10-05 14:56:41 -05:00
|
|
|
// Contains details about the repo: a list of image summaries and a summary of the repo
|
2022-02-01 21:02:05 -05:00
|
|
|
type RepoInfo struct {
|
2022-01-19 10:57:10 -05:00
|
|
|
Images []*ImageSummary `json:"Images"`
|
|
|
|
Summary *RepoSummary `json:"Summary"`
|
2022-02-01 21:02:05 -05:00
|
|
|
}
|
|
|
|
|
2022-10-05 14:56:41 -05:00
|
|
|
// Contains details about the repo
|
2022-07-12 07:58:04 -05:00
|
|
|
type RepoSummary struct {
|
2022-01-19 10:57:10 -05:00
|
|
|
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"`
|
|
|
|
DownloadCount *int `json:"DownloadCount"`
|
|
|
|
StarCount *int `json:"StarCount"`
|
|
|
|
IsBookmarked *bool `json:"IsBookmarked"`
|
2023-01-09 15:37:44 -05:00
|
|
|
IsStarred *bool `json:"IsStarred"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type SortCriteria string
|
|
|
|
|
|
|
|
const (
|
|
|
|
SortCriteriaRelevance SortCriteria = "RELEVANCE"
|
|
|
|
SortCriteriaUpdateTime SortCriteria = "UPDATE_TIME"
|
|
|
|
SortCriteriaAlphabeticAsc SortCriteria = "ALPHABETIC_ASC"
|
|
|
|
SortCriteriaAlphabeticDsc SortCriteria = "ALPHABETIC_DSC"
|
|
|
|
SortCriteriaStars SortCriteria = "STARS"
|
|
|
|
SortCriteriaDownloads SortCriteria = "DOWNLOADS"
|
|
|
|
)
|
|
|
|
|
|
|
|
var AllSortCriteria = []SortCriteria{
|
|
|
|
SortCriteriaRelevance,
|
|
|
|
SortCriteriaUpdateTime,
|
|
|
|
SortCriteriaAlphabeticAsc,
|
|
|
|
SortCriteriaAlphabeticDsc,
|
|
|
|
SortCriteriaStars,
|
|
|
|
SortCriteriaDownloads,
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e SortCriteria) IsValid() bool {
|
|
|
|
switch e {
|
|
|
|
case SortCriteriaRelevance, SortCriteriaUpdateTime, SortCriteriaAlphabeticAsc, SortCriteriaAlphabeticDsc, SortCriteriaStars, SortCriteriaDownloads:
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e SortCriteria) String() string {
|
|
|
|
return string(e)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e *SortCriteria) UnmarshalGQL(v interface{}) error {
|
|
|
|
str, ok := v.(string)
|
|
|
|
if !ok {
|
|
|
|
return fmt.Errorf("enums must be strings")
|
|
|
|
}
|
|
|
|
|
|
|
|
*e = SortCriteria(str)
|
|
|
|
if !e.IsValid() {
|
|
|
|
return fmt.Errorf("%s is not a valid SortCriteria", str)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e SortCriteria) MarshalGQL(w io.Writer) {
|
|
|
|
fmt.Fprint(w, strconv.Quote(e.String()))
|
2020-08-19 01:53:04 -05:00
|
|
|
}
|