baseResolver

package
v1.57.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Standard GraphQL error codes
	ErrorCodeBadRequest      = "BAD_REQUEST"
	ErrorCodeNotFound        = "NOT_FOUND"
	ErrorCodeInternal        = "INTERNAL"
	ErrorCodeUnauthenticated = "UNAUTHENTICATED"
	ErrorCodeForbidden       = "FORBIDDEN"
	ErrorCodeConflict        = "CONFLICT"
	ErrorCodeValidation      = "VALIDATION"
)

GraphQL error codes

Variables

View Source
var (
	FilterDisplayServiceCcrn           string = "Service"
	FilterDisplaySupportGroupCcrn      string = "Support Group"
	FilterDisplayUserName              string = "User Name"
	FilterDisplayUserNameWithId        string = "User"
	FilterDisplayUniqueUserId          string = "Unique User ID"
	FilterDisplayComponentCcrn         string = "Pod"
	FilterDisplayIssueType             string = "Issue Type"
	FilterDisplayIssueMatchStatus      string = "Issue Match Status"
	FilterDisplayIssueMatchID          string = "Issue Match ID"
	FilterDisplayIssuePrimaryName      string = "Issue Name"
	FilterDisplayIssueSeverity         string = "Severity"
	FilterDisplayCcrn                  string = "CCRN"
	FilterDisplayRegion                string = "Region"
	FilterDisplayCluster               string = "Cluster"
	FilterDisplayNamespace             string = "Namespace"
	FilterDisplayDomain                string = "Domain"
	FilterDisplayProject               string = "Project"
	FilterDisplayPod                   string = "Pod"
	FilterDisplayContainer             string = "Container"
	FilterDisplayComponentInstanceType string = "Component Instance Type"
	FilterDisplayContext               string = "Context"

	ServiceFilterServiceCcrn      string = "serviceCcrn"
	ServiceFilterDomain           string = "domain"
	ServiceFilterRegion           string = "region"
	ServiceFilterUniqueUserId     string = "uniqueUserId"
	ServiceFilterType             string = "type"
	ServiceFilterUserName         string = "userName"
	ServiceFilterSupportGroupCcrn string = "supportGroupCcrn"
	ServiceFilterUserNameWithId   string = "uniqueUserId"

	IssueMatchFilterPrimaryName      string = "primaryName"
	IssueMatchFilterComponentCcrn    string = "componentCcrn"
	IssueMatchFilterIssueType        string = "issueType"
	IssueMatchFilterStatus           string = "status"
	IssueMatchFilterSeverity         string = "severity"
	IssueMatchFilterServiceCcrn      string = "serviceCcrn"
	IssueMatchFilterSupportGroupCcrn string = "supportGroupCcrn"

	ComponentInstanceFilterComponentCcrn string = "componentCcrn"
	ComponentInstanceFilterRegion        string = "region"
	ComponentInstanceFilterCluster       string = "cluster"
	ComponentInstanceFilterNamespace     string = "namespace"
	ComponentInstanceFilterDomain        string = "domain"
	ComponentInstanceFilterProject       string = "project"
	ComponentInstanceFilterPod           string = "pod"
	ComponentInstanceFilterContainer     string = "container"
	ComponentInstanceFilterType          string = "type"
	ComponentInstanceFilterParentId      string = "parentId"

	VulnerabilityFilterSupportGroup string = "supportGroup"
	VulnerabilityFilterSeverity     string = "severity"
	VulnerabilityFilterService      string = "service"
	VulnerabilityFilterRegion       string = "region"
)

Functions

func CcrnBaseResolver

func CcrnBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.ComponentInstanceFilter,
) (*model.FilterItem, error)

func ClusterBaseResolver

func ClusterBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.ComponentInstanceFilter,
) (*model.FilterItem, error)

func ComponentBaseResolver

func ComponentBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.ComponentFilter,
	first *int,
	after *string,
	parent *model.NodeParent,
) (*model.ComponentConnection, error)

func ComponentCcrnBaseResolver

func ComponentCcrnBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.ComponentFilter,
) (*model.FilterItem, error)

func ComponentInstanceBaseResolver

func ComponentInstanceBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.ComponentInstanceFilter,
	first *int,
	after *string,
	orderBy []*model.ComponentInstanceOrderBy,
	parent *model.NodeParent,
) (*model.ComponentInstanceConnection, error)

func ComponentInstanceFilterBaseResolver

func ComponentInstanceFilterBaseResolver(
	appCall func(filter *entity.ComponentInstanceFilter, options *entity.ListOptions) ([]string, error),
	ctx context.Context,
	filter *model.ComponentInstanceFilter,
	filterDisplay *string,
) (*model.FilterItem, error)

func ComponentIssueCountsBaseResolver added in v1.18.0

func ComponentIssueCountsBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.ComponentFilter,
	parent *model.NodeParent,
) (*model.SeverityCounts, error)

func ComponentVersionBaseResolver

func ComponentVersionBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.ComponentVersionFilter,
	first *int,
	after *string,
	orderBy []*model.ComponentVersionOrderBy,
	parent *model.NodeParent,
) (*model.ComponentVersionConnection, error)

func ContainerBaseResolver

func ContainerBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.ComponentInstanceFilter,
) (*model.FilterItem, error)

func ContextBaseResolver

func ContextBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.ComponentInstanceFilter,
) (*model.FilterJSONItem, error)

func DomainBaseResolver

func DomainBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.ComponentInstanceFilter,
) (*model.FilterItem, error)

func EffectiveIssueVariantBaseResolver

func EffectiveIssueVariantBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.IssueVariantFilter,
	first *int,
	after *string,
	parent *model.NodeParent,
) (*model.IssueVariantConnection, error)

func GetIssueListOptions

func GetIssueListOptions(requestedFields []string) *entity.IssueListOptions

func GetListOptions

func GetListOptions(requestedFields []string) *entity.ListOptions

func GetNestedPreloads

func GetNestedPreloads(
	ctx *graphql.OperationContext,
	fields []graphql.CollectedField,
	prefix string,
) (preloads []string)

func GetPreloadString

func GetPreloadString(prefix, name string) string

func GetPreloads

func GetPreloads(ctx context.Context) []string

func GetRoot added in v1.18.0

func GetRoot(fctx *graphql.FieldContext) *graphql.FieldContext

func ImageBaseResolver added in v1.18.0

func ImageBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.ImageFilter,
	first *int,
	after *string,
) (*model.ImageConnection, error)

ImageBaseResolver retrieves a list of images based for a specific service. It's designed for the Image List View in the UI - Default ordering is by Vulnerability Count (descending) and Repository (ascending)

func ImageVersionBaseResolver added in v1.33.0

func ImageVersionBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.ImageVersionFilter,
	first *int,
	after *string,
	parent *model.NodeParent,
) (*model.ImageVersionConnection, error)

func IssueBaseResolver

func IssueBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.IssueFilter,
	first *int,
	after *string,
	orderBy []*model.IssueOrderBy,
	parent *model.NodeParent,
) (*model.IssueConnection, error)

func IssueCountsBaseResolver

func IssueCountsBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.IssueFilter,
	parent *model.NodeParent,
) (*model.SeverityCounts, error)

func IssueMatchBaseResolver

func IssueMatchBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.IssueMatchFilter,
	first *int,
	after *string,
	orderBy []*model.IssueMatchOrderBy,
	parent *model.NodeParent,
) (*model.IssueMatchConnection, error)

func IssueNameBaseResolver

func IssueNameBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.IssueFilter,
) (*model.FilterItem, error)

func IssueRepositoryBaseResolver

func IssueRepositoryBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.IssueRepositoryFilter,
	first *int,
	after *string,
	parent *model.NodeParent,
) (*model.IssueRepositoryConnection, error)

func IssueVariantBaseResolver

func IssueVariantBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.IssueVariantFilter,
	first *int,
	after *string,
	parent *model.NodeParent,
) (*model.IssueVariantConnection, error)

func NamespaceBaseResolver

func NamespaceBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.ComponentInstanceFilter,
) (*model.FilterItem, error)

func ParentBaseResolver added in v1.1.0

func ParentBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.ComponentInstanceFilter,
) (*model.FilterItem, error)

func ParseCursor

func ParseCursor(cursor *string) (*int64, error)

func PatchBaseResolver added in v1.34.0

func PatchBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.PatchFilter,
	first *int,
	after *string,
) (*model.PatchConnection, error)

func PodBaseResolver

func PodBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.ComponentInstanceFilter,
) (*model.FilterItem, error)

func ProjectBaseResolver

func ProjectBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.ComponentInstanceFilter,
) (*model.FilterItem, error)

func RegionBaseResolver

func RegionBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.ComponentInstanceFilter,
) (*model.FilterItem, error)

func RemediationBaseResolver added in v1.25.0

func RemediationBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.RemediationFilter,
	first *int,
	after *string,
	orderBy []*model.RemediationOrderBy,
	parent *model.NodeParent,
) (*model.RemediationConnection, error)

func ScannerRunTagFilterValues

func ScannerRunTagFilterValues(app app.Heureka, ctx context.Context) ([]*string, error)

func ScannerRuns

func ScannerRuns(
	app app.Heureka,
	ctx context.Context,
	filter *model.ScannerRunFilter,
	first *int,
	after *string,
) (*model.ScannerRunConnection, error)

func ServiceBaseResolver

func ServiceBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.ServiceFilter,
	first *int,
	after *string,
	orderBy []*model.ServiceOrderBy,
	parent *model.NodeParent,
) (*model.ServiceConnection, error)

func ServiceCcrnBaseResolver

func ServiceCcrnBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.ServiceFilter,
) (*model.FilterItem, error)

func ServiceDomainBaseResolver added in v1.23.0

func ServiceDomainBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.ServiceFilter,
) (*model.FilterItem, error)

func ServiceFilterBaseResolver added in v1.23.0

func ServiceFilterBaseResolver(
	appCall func(filter *entity.ServiceFilter, opt *entity.ListOptions) ([]string, error),
	ctx context.Context,
	filter *model.ServiceFilter,
	filterDisplay *string,
) (*model.FilterItem, error)

func ServiceRegionBaseResolver added in v1.23.0

func ServiceRegionBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.ServiceFilter,
) (*model.FilterItem, error)

func SingleComponentBaseResolver

func SingleComponentBaseResolver(
	app app.Heureka,
	ctx context.Context,
	parent *model.NodeParent,
) (*model.Component, error)

func SingleComponentInstanceBaseResolver

func SingleComponentInstanceBaseResolver(
	app app.Heureka,
	ctx context.Context,
	parent *model.NodeParent,
) (*model.ComponentInstance, error)

func SingleComponentVersionBaseResolver

func SingleComponentVersionBaseResolver(
	app app.Heureka,
	ctx context.Context,
	parent *model.NodeParent,
) (*model.ComponentVersion, error)

func SingleIssueBaseResolver

func SingleIssueBaseResolver(
	app app.Heureka,
	ctx context.Context,
	parent *model.NodeParent,
) (*model.Issue, error)

func SingleIssueMatchBaseResolver

func SingleIssueMatchBaseResolver(
	app app.Heureka,
	ctx context.Context,
	parent *model.NodeParent,
) (*model.IssueMatch, error)

func SingleIssueRepositoryBaseResolver

func SingleIssueRepositoryBaseResolver(
	app app.Heureka,
	ctx context.Context,
	parent *model.NodeParent,
) (*model.IssueRepository, error)

func SingleIssueVariantBaseResolver

func SingleIssueVariantBaseResolver(
	app app.Heureka,
	ctx context.Context,
	parent *model.NodeParent,
) (*model.IssueVariant, error)

func SingleServiceBaseResolver

func SingleServiceBaseResolver(
	app app.Heureka,
	ctx context.Context,
	parent *model.NodeParent,
) (*model.Service, error)

func SingleUserBaseResolver

func SingleUserBaseResolver(
	app app.Heureka,
	ctx context.Context,
	parent *model.NodeParent,
) (*model.User, error)

func SupportGroupBaseResolver

func SupportGroupBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.SupportGroupFilter,
	first *int,
	after *string,
	orderBy []*model.SupportGroupOrderBy,
	parent *model.NodeParent,
) (*model.SupportGroupConnection, error)

func SupportGroupCcrnBaseResolver

func SupportGroupCcrnBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.SupportGroupFilter,
) (*model.FilterItem, error)

func TypeBaseResolver

func TypeBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.ComponentInstanceFilter,
) (*model.FilterItem, error)

func UniqueUserIDBaseResolver

func UniqueUserIDBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.UserFilter,
) (*model.FilterItem, error)

func UserBaseResolver

func UserBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.UserFilter,
	first *int,
	after *string,
	parent *model.NodeParent,
) (*model.UserConnection, error)

func UserNameBaseResolver

func UserNameBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.UserFilter,
) (*model.FilterItem, error)

func UserNameWithIdBaseResolver

func UserNameWithIdBaseResolver(
	app app.Heureka,
	ctx context.Context,
	filter *model.UserFilter,
) (*model.FilterValueItem, error)

func VulnerabilityBaseResolver

func VulnerabilityBaseResolver(app app.Heureka, ctx context.Context,
	filter *model.VulnerabilityFilter, first *int, after *string, parent *model.NodeParent,
) (*model.VulnerabilityConnection, error)

VulnerabilityBaseResolver retrieves a list of vulnerabilities based on the provided filter and pagination parameters. It's designed for the Vulnerability List View in the UI - Only returns Issues of type Vulnerability - Only returns Issues with at least one IssueMatch with status "new" - Default ordering is by IssueVariantRating (descending) and IssuePrimaryName (ascending)

Types

type GraphQLError added in v1.15.0

type GraphQLError struct {
	Message    string         `json:"message"`
	Path       []any          `json:"path,omitempty"`
	Extensions map[string]any `json:"extensions,omitempty"`
}

GraphQLError represents a standard GraphQL error response

func NewGraphQLError added in v1.15.0

func NewGraphQLError(message string, code string) *GraphQLError

NewGraphQLError creates a new GraphQL error with the given message and code

func ToGraphQLError added in v1.15.0

func ToGraphQLError(err error) *GraphQLError

ToGraphQLError converts an application error to a GraphQL error

func (*GraphQLError) Error added in v1.15.0

func (e *GraphQLError) Error() string

Error implements the error interface

type ResolverError

type ResolverError struct {
	// contains filtered or unexported fields
}

func NewResolverError

func NewResolverError(resolver string, msg string) *ResolverError

func (*ResolverError) Error

func (re *ResolverError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL