libindex

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2019 License: Apache-2.0 Imports: 21 Imported by: 4

Documentation

Overview

Package libindex is a generated GoMock package.

Index

Constants

View Source
const (
	DefaultScanLockRetry        = 5 * time.Second
	DefaultLayerScanConcurrency = 10
	DefaultLayerFetchOpt        = indexer.OnDisk
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ControllerFactory

type ControllerFactory func(lib *libindex, opts *Opts) (*controller.Controller, error)

ControllerFactory is a factory method to return a Controller during libindex runtime.

type Libindex

type Libindex interface {
	// Scan performs an async scan of a manifest and produces a claircore.IndexReport.
	// Errors encountered before scan begins are returned in the error variable.
	// Errors encountered during scan are populated in the Err field of the claircore.IndexReport
	Index(ctx context.Context, manifest *claircore.Manifest) (ResultChannel <-chan *claircore.IndexReport, err error)
	// IndexReport tries to retrieve a claircore.IndexReport given the image hash.
	// bool informs caller if found.
	IndexReport(ctx context.Context, hash string) (*claircore.IndexReport, bool, error)
}

libindex is an interface exporting the public methods of our library.

func New

func New(ctx context.Context, opts *Opts) (Libindex, error)

New creates a new instance of libindex

type MockLibindex

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

MockLibindex is a mock of Libindex interface

func NewMockLibindex

func NewMockLibindex(ctrl *gomock.Controller) *MockLibindex

NewMockLibindex creates a new mock instance

func (*MockLibindex) EXPECT

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

func (*MockLibindex) IndexReport

func (m *MockLibindex) IndexReport(arg0 context.Context, arg1 string) (*claircore.IndexReport, bool, error)

IndexReport mocks base method

func (*MockLibindex) Scan

func (m *MockLibindex) Scan(arg0 context.Context, arg1 *claircore.Manifest) (<-chan *claircore.IndexReport, error)

Scan mocks base method

type MockLibindexMockRecorder

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

MockLibindexMockRecorder is the mock recorder for MockLibindex

func (*MockLibindexMockRecorder) IndexReport

func (mr *MockLibindexMockRecorder) IndexReport(arg0, arg1 interface{}) *gomock.Call

IndexReport indicates an expected call of IndexReport

func (*MockLibindexMockRecorder) Scan

func (mr *MockLibindexMockRecorder) Scan(arg0, arg1 interface{}) *gomock.Call

Scan indicates an expected call of Scan

type Opts

type Opts struct {
	// the connection string for the datastore specified above
	ConnString string
	// how often we should try to acquire a lock for scanning a given manifest if lock is taken
	ScanLockRetry time.Duration
	// the number of layers to be scanned in parellel.
	LayerScanConcurrency int
	// how we store layers we fetch remotely. see LayerFetchOpt type def above for more details
	LayerFetchOpt indexer.LayerFetchOpt
	// set to true to have libindex check and potentially run migrations
	Migrations bool
	// provides an alternative method for creating a scanner during libindex runtime
	// if nil the default factory will be used. useful for testing purposes
	ControllerFactory ControllerFactory
	// a list of ecosystems to use which define which package databases and coalescing methods we use
	Ecosystems []*indexer.Ecosystem
	// contains filtered or unexported fields
}

Opts are depedencies and options for constructing an instance of libindex

func (*Opts) Parse

func (o *Opts) Parse() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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