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"
|
|
|
|
)
|
|
|
|
|
2023-02-02 15:46:35 -05:00
|
|
|
// Annotation is Key:Value pair representing custom data which is otherwise
|
|
|
|
// not available in other fields.
|
2022-11-23 13:53:28 -05:00
|
|
|
type Annotation struct {
|
2023-02-02 15:46:35 -05:00
|
|
|
// Custom key
|
|
|
|
Key *string `json:"Key"`
|
|
|
|
// Value associated with the custom key
|
2022-11-23 13:53:28 -05:00
|
|
|
Value *string `json:"Value"`
|
|
|
|
}
|
|
|
|
|
2023-02-02 15:46:35 -05:00
|
|
|
// Contains various details about the CVE (Common Vulnerabilities and Exposures)
|
|
|
|
// and a list of PackageInfo about the affected packages
|
2020-06-26 14:09:10 -05:00
|
|
|
type Cve struct {
|
2023-02-02 15:46:35 -05:00
|
|
|
// CVE ID
|
|
|
|
ID *string `json:"Id"`
|
|
|
|
// A short title describing the CVE
|
|
|
|
Title *string `json:"Title"`
|
|
|
|
// A detailed description of the CVE
|
|
|
|
Description *string `json:"Description"`
|
|
|
|
// The impact the CVE has, one of "UNKNOWN", "LOW", "MEDIUM", "HIGH", "CRITICAL"
|
|
|
|
Severity *string `json:"Severity"`
|
|
|
|
// Information on the packages in which the CVE was found
|
2020-06-26 14:09:10 -05:00
|
|
|
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 {
|
2023-02-02 15:46:35 -05:00
|
|
|
// Tag affected by the CVEs
|
|
|
|
Tag *string `json:"Tag"`
|
|
|
|
// List of CVE objects which afect this specific image:tag
|
|
|
|
CVEList []*Cve `json:"CVEList"`
|
|
|
|
// The CVE pagination information, see PageInfo object for more details
|
|
|
|
Page *PageInfo `json:"Page"`
|
2020-06-26 14:09:10 -05:00
|
|
|
}
|
|
|
|
|
2023-02-02 15:46:35 -05:00
|
|
|
// Apply various types of filters to the queries made for repositories and images
|
|
|
|
// For example we only want to display repositories which contain images with
|
|
|
|
// a certain OS ar Architecture.
|
2023-01-09 15:37:44 -05:00
|
|
|
type Filter struct {
|
2023-02-02 15:46:35 -05:00
|
|
|
// Only return images or repositories supporting the operating systems in the list
|
|
|
|
// Should be values listed in the Go Language document https://go.dev/doc/install/source#environment
|
|
|
|
Os []*string `json:"Os"`
|
|
|
|
// Only return images or repositories supporting the build architectures in the list
|
|
|
|
// Should be values listed in the Go Language document https://go.dev/doc/install/source#environment
|
|
|
|
Arch []*string `json:"Arch"`
|
|
|
|
// Only return images or repositories with at least one signature
|
|
|
|
HasToBeSigned *bool `json:"HasToBeSigned"`
|
2023-01-09 15:37:44 -05:00
|
|
|
}
|
|
|
|
|
2023-02-02 15:46:35 -05:00
|
|
|
// Search results, can contain images, repositories and layers
|
2022-07-12 07:58:04 -05:00
|
|
|
type GlobalSearchResult struct {
|
2023-02-02 15:46:35 -05:00
|
|
|
// Pagination information
|
|
|
|
Page *PageInfo `json:"Page"`
|
|
|
|
// List of images matching the search criteria
|
2022-07-12 07:58:04 -05:00
|
|
|
Images []*ImageSummary `json:"Images"`
|
2023-02-02 15:46:35 -05:00
|
|
|
// List of repositories matching the search criteria
|
|
|
|
Repos []*RepoSummary `json:"Repos"`
|
|
|
|
// List of layers matching the search criteria
|
|
|
|
// NOTE: the actual search logic for layers is not implemented at the moment
|
2022-07-12 07:58:04 -05:00
|
|
|
Layers []*LayerSummary `json:"Layers"`
|
|
|
|
}
|
|
|
|
|
2023-02-02 15:46:35 -05:00
|
|
|
// Information on how a layer was created
|
2022-09-21 12:53:56 -05:00
|
|
|
type HistoryDescription struct {
|
2023-02-02 15:46:35 -05:00
|
|
|
// Created is the time when the layer was created.
|
2022-09-21 12:53:56 -05:00
|
|
|
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"`
|
|
|
|
}
|
|
|
|
|
2023-02-02 15:46:35 -05:00
|
|
|
// Details about a specific image, it is used by queries returning a list of images
|
|
|
|
// We define an image as a pairing or a repository and a tag belonging to that repository
|
2022-07-12 07:58:04 -05:00
|
|
|
type ImageSummary struct {
|
2023-02-02 15:46:35 -05:00
|
|
|
// Name of the repository where the image is found
|
|
|
|
RepoName *string `json:"RepoName"`
|
|
|
|
// Tag identifying the image within the repository
|
|
|
|
Tag *string `json:"Tag"`
|
|
|
|
// Digest of the manifest file associated with this image
|
|
|
|
Digest *string `json:"Digest"`
|
|
|
|
// Digest of the config file associated with this image
|
|
|
|
ConfigDigest *string `json:"ConfigDigest"`
|
|
|
|
// Timestamp of the last modification done to the image (from config or the last updated layer)
|
|
|
|
LastUpdated *time.Time `json:"LastUpdated"`
|
|
|
|
// True if the image has a signature associated with it, false otherwise
|
|
|
|
IsSigned *bool `json:"IsSigned"`
|
|
|
|
// Total size of the files associated with this image (manigest, config, layers)
|
|
|
|
Size *string `json:"Size"`
|
|
|
|
// OS and architecture supported by this image
|
|
|
|
Platform *OsArch `json:"Platform"`
|
|
|
|
// Vendor associated with this image, the distributing entity, organization or individual
|
|
|
|
Vendor *string `json:"Vendor"`
|
|
|
|
// Integer used to rank search results by relevance
|
|
|
|
Score *int `json:"Score"`
|
|
|
|
// Number of downloads of the manifest of this image
|
|
|
|
DownloadCount *int `json:"DownloadCount"`
|
|
|
|
// Information on the layers of this image
|
|
|
|
Layers []*LayerSummary `json:"Layers"`
|
|
|
|
// Human-readable description of the software packaged in the image
|
|
|
|
Description *string `json:"Description"`
|
|
|
|
// License(s) under which contained software is distributed as an SPDX License Expression
|
|
|
|
Licenses *string `json:"Licenses"`
|
|
|
|
// Labels associated with this image
|
|
|
|
// NOTE: currently this field is unused
|
|
|
|
Labels *string `json:"Labels"`
|
|
|
|
// Human-readable title of the image
|
|
|
|
Title *string `json:"Title"`
|
|
|
|
// URL to get source code for building the image
|
|
|
|
Source *string `json:"Source"`
|
|
|
|
// URL to get documentation on the image
|
|
|
|
Documentation *string `json:"Documentation"`
|
|
|
|
// Information about the history of the specific image, see LayerHistory
|
|
|
|
History []*LayerHistory `json:"History"`
|
|
|
|
// Short summary of the identified CVEs
|
2022-09-28 13:39:54 -05:00
|
|
|
Vulnerabilities *ImageVulnerabilitySummary `json:"Vulnerabilities"`
|
2023-02-02 15:46:35 -05:00
|
|
|
// Contact details of the people or organization responsible for the image
|
|
|
|
Authors *string `json:"Authors"`
|
2022-09-28 13:39:54 -05:00
|
|
|
}
|
|
|
|
|
2023-02-02 15:46:35 -05:00
|
|
|
// Contains summary of vulnerabilities found in a specific image
|
2022-09-28 13:39:54 -05:00
|
|
|
type ImageVulnerabilitySummary struct {
|
2023-02-02 15:46:35 -05:00
|
|
|
// Maximum severity of all CVEs found in this image
|
2022-09-28 13:39:54 -05:00
|
|
|
MaxSeverity *string `json:"MaxSeverity"`
|
2023-02-02 15:46:35 -05:00
|
|
|
// Count of all CVEs found in this image
|
|
|
|
Count *int `json:"Count"`
|
2022-09-21 12:53:56 -05:00
|
|
|
}
|
|
|
|
|
2023-02-02 15:46:35 -05:00
|
|
|
// Information about how/when a layer was built
|
2022-09-21 12:53:56 -05:00
|
|
|
type LayerHistory struct {
|
2023-02-02 15:46:35 -05:00
|
|
|
// Information specific to the layer such as size and digest.
|
|
|
|
Layer *LayerSummary `json:"Layer"`
|
|
|
|
// Additional information about how the layer was created.
|
2022-09-21 12:53:56 -05:00
|
|
|
HistoryDescription *HistoryDescription `json:"HistoryDescription"`
|
2022-02-01 21:02:05 -05:00
|
|
|
}
|
|
|
|
|
2023-02-02 15:46:35 -05:00
|
|
|
// Contains details about a specific layer which is part of an image
|
2022-07-12 07:58:04 -05:00
|
|
|
type LayerSummary struct {
|
2023-02-02 15:46:35 -05:00
|
|
|
// The size of the layer in bytes
|
|
|
|
Size *string `json:"Size"`
|
|
|
|
// Digest of the layer content
|
2022-07-12 07:58:04 -05:00
|
|
|
Digest *string `json:"Digest"`
|
2023-02-02 15:46:35 -05:00
|
|
|
// Integer used to rank search results by relevance
|
|
|
|
Score *int `json:"Score"`
|
2022-07-12 07:58:04 -05:00
|
|
|
}
|
|
|
|
|
2023-02-02 15:46:35 -05:00
|
|
|
// Contains details about the OS and architecture of the image
|
2022-07-12 07:58:04 -05:00
|
|
|
type OsArch struct {
|
2023-02-02 15:46:35 -05:00
|
|
|
// The name of the operating system which the image is built to run on,
|
|
|
|
// Should be values listed in the Go Language document https://go.dev/doc/install/source#environment
|
|
|
|
Os *string `json:"Os"`
|
|
|
|
// The name of the compilation architecture which the image is built to run on,
|
|
|
|
// Should be values listed in the Go Language document https://go.dev/doc/install/source#environment
|
2022-07-12 07:58:04 -05:00
|
|
|
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 {
|
2023-02-02 15:46:35 -05:00
|
|
|
// Name of the package affected by a CVE
|
|
|
|
Name *string `json:"Name"`
|
|
|
|
// Current version of the package, typically affected by the CVE
|
2020-06-26 14:09:10 -05:00
|
|
|
InstalledVersion *string `json:"InstalledVersion"`
|
2023-02-02 15:46:35 -05:00
|
|
|
// Minimum version of the package in which the CVE is fixed
|
|
|
|
FixedVersion *string `json:"FixedVersion"`
|
2020-06-26 14:09:10 -05:00
|
|
|
}
|
2020-08-19 01:53:04 -05:00
|
|
|
|
2023-02-02 15:46:35 -05:00
|
|
|
// Information on current page returned by the API
|
2023-01-09 15:37:44 -05:00
|
|
|
type PageInfo struct {
|
2023-02-02 15:46:35 -05:00
|
|
|
// The total number of objects on all pages
|
2023-01-18 17:20:55 -05:00
|
|
|
TotalCount int `json:"TotalCount"`
|
2023-02-02 15:46:35 -05:00
|
|
|
// The number of objects in this page
|
|
|
|
ItemCount int `json:"ItemCount"`
|
2023-01-09 15:37:44 -05:00
|
|
|
}
|
|
|
|
|
2023-02-02 15:46:35 -05:00
|
|
|
// Pagination parameters
|
|
|
|
// If PageInput is empty, the request should return all objects.
|
2023-01-09 15:37:44 -05:00
|
|
|
type PageInput struct {
|
2023-02-02 15:46:35 -05:00
|
|
|
// The maximum amount of results to return for this page
|
|
|
|
// Negative values are not allowed
|
|
|
|
Limit *int `json:"limit"`
|
|
|
|
// The results page number you want to receive
|
|
|
|
// Negative values are not allowed
|
|
|
|
Offset *int `json:"offset"`
|
|
|
|
// The criteria used to sort the results on the page
|
2023-01-09 15:37:44 -05:00
|
|
|
SortBy *SortCriteria `json:"sortBy"`
|
|
|
|
}
|
|
|
|
|
2023-02-02 15:46:35 -05:00
|
|
|
// Paginated list of ImageSummary objects
|
2023-01-18 17:20:55 -05:00
|
|
|
type PaginatedImagesResult struct {
|
2023-02-02 15:46:35 -05:00
|
|
|
// Information on the returned page
|
|
|
|
Page *PageInfo `json:"Page"`
|
|
|
|
// List of images
|
2023-01-18 17:20:55 -05:00
|
|
|
Results []*ImageSummary `json:"Results"`
|
|
|
|
}
|
|
|
|
|
2023-02-02 15:46:35 -05:00
|
|
|
// Paginated list of RepoSummary objects
|
2023-01-18 17:20:55 -05:00
|
|
|
type PaginatedReposResult struct {
|
2023-02-02 15:46:35 -05:00
|
|
|
// Information on the returned page
|
|
|
|
Page *PageInfo `json:"Page"`
|
|
|
|
// List of repositories
|
2023-01-18 17:20:55 -05:00
|
|
|
Results []*RepoSummary `json:"Results"`
|
|
|
|
}
|
|
|
|
|
2023-02-02 15:46:35 -05:00
|
|
|
// A referrer is an object which has a reference to a another object
|
2022-11-23 13:53:28 -05:00
|
|
|
type Referrer struct {
|
2023-02-02 15:46:35 -05:00
|
|
|
// Referrer MediaType
|
|
|
|
// See https://github.com/opencontainers/artifacts for more details
|
|
|
|
MediaType *string `json:"MediaType"`
|
|
|
|
// Referrer ArtifactType
|
|
|
|
// See https://github.com/opencontainers/artifacts for more details
|
|
|
|
ArtifactType *string `json:"ArtifactType"`
|
|
|
|
// Total size of the referrer files in bytes
|
|
|
|
Size *int `json:"Size"`
|
|
|
|
// Digest of the manifest file of the referrer
|
|
|
|
Digest *string `json:"Digest"`
|
|
|
|
// A list of annotations associated with this referrer
|
|
|
|
Annotations []*Annotation `json:"Annotations"`
|
2022-11-23 13:53:28 -05:00
|
|
|
}
|
|
|
|
|
2023-02-02 15:46:35 -05:00
|
|
|
// Contains details about the repo: both general information on the repo, and the list of images
|
2022-02-01 21:02:05 -05:00
|
|
|
type RepoInfo struct {
|
2023-02-02 15:46:35 -05:00
|
|
|
// List of images in the repo
|
|
|
|
Images []*ImageSummary `json:"Images"`
|
|
|
|
// Details about the repository itself
|
|
|
|
Summary *RepoSummary `json:"Summary"`
|
2022-02-01 21:02:05 -05:00
|
|
|
}
|
|
|
|
|
2023-02-02 15:46:35 -05:00
|
|
|
// Details of a specific repo, it is used by queries returning a list of repos
|
2022-07-12 07:58:04 -05:00
|
|
|
type RepoSummary struct {
|
2023-02-02 15:46:35 -05:00
|
|
|
// Name of the repository
|
|
|
|
Name *string `json:"Name"`
|
|
|
|
// Timestamp of the last update to an image inside this repository
|
|
|
|
LastUpdated *time.Time `json:"LastUpdated"`
|
|
|
|
// Total size of the files within this repository
|
|
|
|
Size *string `json:"Size"`
|
|
|
|
// List of platforms supported by this repository
|
|
|
|
Platforms []*OsArch `json:"Platforms"`
|
|
|
|
// Vendors associated with this image, the distributing entities, organizations or individuals
|
|
|
|
Vendors []*string `json:"Vendors"`
|
|
|
|
// Integer used to rank search results by relevance
|
|
|
|
Score *int `json:"Score"`
|
|
|
|
// Details of the newest image inside the repository
|
|
|
|
// NOTE: not the image with the `latest` tag, the one with the most recent created timestamp
|
|
|
|
NewestImage *ImageSummary `json:"NewestImage"`
|
|
|
|
// Total numer of image manifest downloads from this repository
|
|
|
|
DownloadCount *int `json:"DownloadCount"`
|
|
|
|
// Number of stars attributed to this repository by users
|
|
|
|
StarCount *int `json:"StarCount"`
|
|
|
|
// True if the repository is bookmarked by the current user, false otherwise
|
|
|
|
IsBookmarked *bool `json:"IsBookmarked"`
|
|
|
|
// True if the repository is stared by the current user, fale otherwise
|
|
|
|
IsStarred *bool `json:"IsStarred"`
|
2023-01-09 15:37:44 -05:00
|
|
|
}
|
|
|
|
|
2023-02-02 15:46:35 -05:00
|
|
|
// All sort criteria usable with pagination, some of these criteria applies only
|
|
|
|
// to certain queries. For example sort by severity is available for CVEs but not
|
|
|
|
// for repositories
|
2023-01-09 15:37:44 -05:00
|
|
|
type SortCriteria string
|
|
|
|
|
|
|
|
const (
|
2023-02-02 15:46:35 -05:00
|
|
|
// How relevant the result is based on the user input used while searching
|
|
|
|
// Applies to: images and repositories
|
|
|
|
SortCriteriaRelevance SortCriteria = "RELEVANCE"
|
|
|
|
// Sort by the most recently created timestamp of the images
|
|
|
|
// Applies to: images and repositories
|
|
|
|
SortCriteriaUpdateTime SortCriteria = "UPDATE_TIME"
|
|
|
|
// Sort alphabetically ascending
|
|
|
|
// Applies to: images, repositories and CVEs
|
2023-01-09 15:37:44 -05:00
|
|
|
SortCriteriaAlphabeticAsc SortCriteria = "ALPHABETIC_ASC"
|
2023-02-02 15:46:35 -05:00
|
|
|
// Sort alphabetically descending
|
|
|
|
// Applies to: images, repositories and CVEs
|
2023-01-09 15:37:44 -05:00
|
|
|
SortCriteriaAlphabeticDsc SortCriteria = "ALPHABETIC_DSC"
|
2023-02-02 15:46:35 -05:00
|
|
|
// Sort from the most severe to the least severe
|
|
|
|
// Applies to: CVEs
|
|
|
|
SortCriteriaSeverity SortCriteria = "SEVERITY"
|
|
|
|
// Sort by the total number of stars given by users
|
|
|
|
// Applies to: repositories
|
|
|
|
SortCriteriaStars SortCriteria = "STARS"
|
|
|
|
// Sort by the total download count
|
|
|
|
// Applies to: repositories and images
|
|
|
|
SortCriteriaDownloads SortCriteria = "DOWNLOADS"
|
2023-01-09 15:37:44 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
var AllSortCriteria = []SortCriteria{
|
|
|
|
SortCriteriaRelevance,
|
|
|
|
SortCriteriaUpdateTime,
|
|
|
|
SortCriteriaAlphabeticAsc,
|
|
|
|
SortCriteriaAlphabeticDsc,
|
2023-01-24 18:03:10 -05:00
|
|
|
SortCriteriaSeverity,
|
2023-01-09 15:37:44 -05:00
|
|
|
SortCriteriaStars,
|
|
|
|
SortCriteriaDownloads,
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e SortCriteria) IsValid() bool {
|
|
|
|
switch e {
|
2023-01-24 18:03:10 -05:00
|
|
|
case SortCriteriaRelevance, SortCriteriaUpdateTime, SortCriteriaAlphabeticAsc, SortCriteriaAlphabeticDsc, SortCriteriaSeverity, SortCriteriaStars, SortCriteriaDownloads:
|
2023-01-09 15:37:44 -05:00
|
|
|
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
|
|
|
}
|