matcher

package
v4.7.4 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Differ

type Differ interface {
	// DeleteUpdateOperations marks the provided refs as seen and processed.
	DeleteUpdateOperations(context.Context, ...uuid.UUID) (int64, error)
	// UpdateDiff reports the differences between the provided refs.
	//
	// "Prev" can be `uuid.Nil` to indicate "earliest known ref."
	UpdateDiff(_ context.Context, prev, cur uuid.UUID) (*driver.UpdateDiff, error)
	// UpdateOperations returns all the known UpdateOperations per updater.
	UpdateOperations(context.Context, driver.UpdateKind, ...string) (map[string][]driver.UpdateOperation, error)
	// LatestUpdateOperations returns the most recent UpdateOperation per updater.
	LatestUpdateOperations(context.Context, driver.UpdateKind) (map[string][]driver.UpdateOperation, error)
	// LatestUpdateOperation returns a ref for the most recent update operation
	// across all updaters.
	LatestUpdateOperation(context.Context, driver.UpdateKind) (uuid.UUID, error)
}

Differ is an interface providing information on update operations.

type Mock

type Mock struct {
	DeleteUpdateOperations_ func(context.Context, ...uuid.UUID) (int64, error)
	UpdateOperations_       func(context.Context, driver.UpdateKind, ...string) (map[string][]driver.UpdateOperation, error)
	LatestUpdateOperation_  func(context.Context, driver.UpdateKind) (uuid.UUID, error)
	LatestUpdateOperations_ func(context.Context, driver.UpdateKind) (map[string][]driver.UpdateOperation, error)
	UpdateDiff_             func(context.Context, uuid.UUID, uuid.UUID) (*driver.UpdateDiff, error)
	Scan_                   func(context.Context, *claircore.IndexReport) (*claircore.VulnerabilityReport, error)
	Initialized_            func(context.Context) (bool, error)
	// TestUOs provide memory for the mock.
	// usage of this field can be dictated by the test case's needs.
	sync.Mutex
	TestUOs map[string][]driver.UpdateOperation
}

Mock implements a mock matcher service

If a method is not provided to a constructed Mock a panic will occur on call.

func (*Mock) DeleteUpdateOperations

func (d *Mock) DeleteUpdateOperations(ctx context.Context, refs ...uuid.UUID) (int64, error)

DeleteUpdateOperations marks the provided refs as seen and processed.

func (*Mock) Initialized added in v4.1.0

func (d *Mock) Initialized(ctx context.Context) (bool, error)

func (*Mock) LatestUpdateOperation

func (d *Mock) LatestUpdateOperation(ctx context.Context, k driver.UpdateKind) (uuid.UUID, error)

LatestUpdateOperation returns a ref for the most recent update operation across all updaters.

func (*Mock) LatestUpdateOperations

func (d *Mock) LatestUpdateOperations(ctx context.Context, k driver.UpdateKind) (map[string][]driver.UpdateOperation, error)

LatestUpdateOperations returns the most recent UpdateOperation per updater.

func (*Mock) Scan

func (*Mock) UpdateDiff

func (d *Mock) UpdateDiff(ctx context.Context, prev uuid.UUID, cur uuid.UUID) (*driver.UpdateDiff, error)

UpdateDiff reports the differences between the provided refs.

"Prev" can be `uuid.Nil` to indicate "earliest known ref."

func (*Mock) UpdateOperations

func (d *Mock) UpdateOperations(ctx context.Context, k driver.UpdateKind, updaters ...string) (map[string][]driver.UpdateOperation, error)

UpdateOperations returns all the known UpdateOperations per updater.

type Scanner

type Scanner interface {
	Initialized(context.Context) (bool, error)
	Scan(ctx context.Context, ir *claircore.IndexReport) (*claircore.VulnerabilityReport, error)
}

Scanner is an interface providing a claircore.VulnerabilityReport given a claircore.IndexReport

type Service

type Service interface {
	Scanner
	Differ
}

Service is an aggregate interface wrapping claircore.Libvuln functionality.

Implementation may use a local instance of claircore.Libindex or a remote instance via http or grpc client.

Jump to

Keyboard shortcuts

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