libscan

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package libscan is a generated GoMock package.

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

Types

type ControllerFactory

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

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

type DataStore

type DataStore string

DataStore tells libscan which backing persistence store to instantiate

const (
	Postgres DataStore = "postgres"
)

type Libscan

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

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

func New

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

New creates a new instance of Libscan

type MockLibscan

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

MockLibscan is a mock of Libscan interface

func NewMockLibscan

func NewMockLibscan(ctrl *gomock.Controller) *MockLibscan

NewMockLibscan creates a new mock instance

func (*MockLibscan) EXPECT

func (m *MockLibscan) EXPECT() *MockLibscanMockRecorder

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

func (*MockLibscan) Scan

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

Scan mocks base method

func (*MockLibscan) ScanReport

func (m *MockLibscan) ScanReport(arg0 context.Context, arg1 string) (*claircore.ScanReport, bool, error)

ScanReport mocks base method

type MockLibscanMockRecorder

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

MockLibscanMockRecorder is the mock recorder for MockLibscan

func (*MockLibscanMockRecorder) Scan

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

Scan indicates an expected call of Scan

func (*MockLibscanMockRecorder) ScanReport

func (mr *MockLibscanMockRecorder) ScanReport(arg0, arg1 interface{}) *gomock.Call

ScanReport indicates an expected call of ScanReport

type Opts

type Opts struct {
	// the datastore this instance of libscan will use
	DataStore DataStore
	// the connection string for the datastore specified above
	ConnString string
	// the type of ScanLock implementation to use. currently postgres is supported
	ScanLock ScanLock
	// 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 scanner.LayerFetchOpt
	// provides an alternative method for creating a scanner during libscan 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 []*scanner.Ecosystem
	// contains filtered or unexported fields
}

Opts are depedencies and options for constructing an instance of libscan

func (*Opts) Parse

func (o *Opts) Parse() error

type ScanLock

type ScanLock string

ScanLock tells libscan which distributed locking implementation to use

const (
	PostgresSL ScanLock = "postgres"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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