vulnstore

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package vulnstore is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetOpts

type GetOpts struct {
	// Matchers tells the Get() method to limit the returned vulnerabilities by the provided MatchConstraint
	// see MatchConstraint type def for more info.
	Matchers []driver.MatchConstraint
	// Debug asks the database layer to log exta information
	Debug bool
}

GetOpts provides instructions on how to match your packages to vulnerabilities.

type MockUpdater

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

MockUpdater is a mock of Updater interface

func NewMockUpdater

func NewMockUpdater(ctrl *gomock.Controller) *MockUpdater

NewMockUpdater creates a new mock instance

func (*MockUpdater) EXPECT

func (m *MockUpdater) EXPECT() *MockUpdaterMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockUpdater) GetHash

func (m *MockUpdater) GetHash(arg0 context.Context, arg1 string) (string, error)

GetHash mocks base method

func (*MockUpdater) PutVulnerabilities

func (m *MockUpdater) PutVulnerabilities(arg0 context.Context, arg1, arg2 string, arg3 []*claircore.Vulnerability) error

PutVulnerabilities mocks base method

type MockUpdaterMockRecorder

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

MockUpdaterMockRecorder is the mock recorder for MockUpdater

func (*MockUpdaterMockRecorder) GetHash

func (mr *MockUpdaterMockRecorder) GetHash(arg0, arg1 interface{}) *gomock.Call

GetHash indicates an expected call of GetHash

func (*MockUpdaterMockRecorder) PutVulnerabilities

func (mr *MockUpdaterMockRecorder) PutVulnerabilities(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

PutVulnerabilities indicates an expected call of PutVulnerabilities

type Store

type Store interface {
	Updater
	Vulnerability
}

Store aggregates all interface types

type Updater

type Updater interface {
	// GetHash should retrieve the latest value that the updater identified by a unique key
	// key will often be a claircore.Updater's unique name
	GetHash(ctx context.Context, key string) (string, error)
	// PutVulnerabilities should write the given vulnerabilties to the database and associate
	// these vulnerabilities with the updater and the newest update hash
	PutVulnerabilities(ctx context.Context, updater string, hash string, vulns []*claircore.Vulnerability) error
}

Updater is an interface exporting the necessary methods for updating a vulnerability database

type Vulnerability

type Vulnerability interface {
	// get finds the vulnerabilities which match each package provided in the packages array
	// this maybe a one to many relationship. each package is assumed to have an ID.
	// a map of Package.ID => Vulnerabilities is returned.
	Get(ctx context.Context, records []*claircore.IndexRecord, opts GetOpts) (map[string][]*claircore.Vulnerability, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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