indexer

package
v4.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Affected

type Affected interface {
	AffectedManifests(ctx context.Context, vulns []claircore.Vulnerability) (*claircore.AffectedManifests, error)
}

Affected is an interface for reporting the manifests affected by a set of vulnerabilities.

type Indexer

type Indexer interface {
	Index(ctx context.Context, manifest *claircore.Manifest) (*claircore.IndexReport, error)
	DeleteManifests(context.Context, ...claircore.Digest) ([]claircore.Digest, error)
}

Indexer is an interface for computing a IndexReport given a Manifest.

type Mock

type Mock struct {
	Index_             func(ctx context.Context, manifest *claircore.Manifest) (*claircore.IndexReport, error)
	IndexReport_       func(ctx context.Context, digest claircore.Digest) (*claircore.IndexReport, bool, error)
	State_             func(ctx context.Context) (string, error)
	AffectedManifests_ func(ctx context.Context, vulns []claircore.Vulnerability) (*claircore.AffectedManifests, error)
	DeleteManifests_   func(context.Context, ...claircore.Digest) ([]claircore.Digest, error)
}

Mock implements a mock indexer Service

If a particular method is not provided an implementation to a constructed Mock an "unexpected call" panic will occur.

func (*Mock) AffectedManifests

func (i *Mock) AffectedManifests(ctx context.Context, vulns []claircore.Vulnerability) (*claircore.AffectedManifests, error)

func (*Mock) DeleteManifests added in v4.4.0

func (i *Mock) DeleteManifests(ctx context.Context, d ...claircore.Digest) ([]claircore.Digest, error)

func (*Mock) Index

func (i *Mock) Index(ctx context.Context, manifest *claircore.Manifest) (*claircore.IndexReport, error)

func (*Mock) IndexReport

func (i *Mock) IndexReport(ctx context.Context, digest claircore.Digest) (*claircore.IndexReport, bool, error)

func (*Mock) State

func (i *Mock) State(ctx context.Context) (string, error)

type Reporter

type Reporter interface {
	IndexReport(ctx context.Context, digest claircore.Digest) (*claircore.IndexReport, bool, error)
}

Reporter is an interface for retreiving an IndexReport given a manifest digest.

type Service

type Service interface {
	Indexer
	Reporter
	Stater
	Affected
}

Service is an aggregate interface wrapping claircore.Libindex functionality.

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

type StateIndexer

type StateIndexer interface {
	Indexer
	Stater
}

StateIndexer is an aggregate interface providing both a Indexer and a Stater method set

type StateReporter

type StateReporter interface {
	Reporter
	Stater
}

StateReporter is an aggregate interface providing both a Reporter and a Stater method set

type Stater

type Stater interface {
	State(ctx context.Context) (string, error)
}

Stater is an interface which provides a unique token symbolizing a Clair's state.

Jump to

Keyboard shortcuts

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