clienttest

package
v2.3.2 Latest Latest
Warning

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

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

Documentation

Overview

Package clienttest provides a mock resolution client for testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMockResolutionClient

func NewMockResolutionClient(t *testing.T, universeYaml, vulnJSON string) client.ResolutionClient

Types

type ResolutionUniverse

type ResolutionUniverse struct {
	System string `yaml:"system"`
	Schema string `yaml:"schema"`
}

type VulnerabilityMatcher added in v2.3.0

type VulnerabilityMatcher struct {
	Vulns []*osvschema.Vulnerability `json:"vulns"`
}

func (*VulnerabilityMatcher) MatchVulnerabilities added in v2.3.0

func (vm *VulnerabilityMatcher) MatchVulnerabilities(_ context.Context, invs []*extractor.Package) ([][]*osvschema.Vulnerability, error)

func (*VulnerabilityMatcher) UnmarshalJSON added in v2.3.0

func (vm *VulnerabilityMatcher) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the mock vulns. The Vulnerability field is a proto message, so it needs to be unmarshaled with protojson.

Jump to

Keyboard shortcuts

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