mock

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyExpectations

func ApplyExpectations(t *testing.T, mock interface{}, expectations ...*Expectation)

ApplyExpectation applies the specified expectations on a given mock.

Types

type ClairClient

type ClairClient struct {
	mock.Mock
}

func NewClairClient

func NewClairClient() *ClairClient

func (*ClairClient) GetLayer

func (cc *ClairClient) GetLayer(layerName string) (*clair.LayerEnvelope, error)

func (*ClairClient) GetVulnerabilityDatabaseUpdatedAt added in v1.0.1

func (cc *ClairClient) GetVulnerabilityDatabaseUpdatedAt() (*time.Time, error)

func (*ClairClient) ScanLayer

func (cc *ClairClient) ScanLayer(l clair.Layer) error

type Enqueuer added in v1.0.1

type Enqueuer struct {
	mock.Mock
}

func NewEnqueuer added in v1.0.1

func NewEnqueuer() *Enqueuer

func (*Enqueuer) Enqueue added in v1.0.1

func (e *Enqueuer) Enqueue(request harbor.ScanRequest) (string, error)

type Expectation

type Expectation struct {
	Method     string
	Args       []interface{}
	ReturnArgs []interface{}
}

Expectation represents an expectation of a method being called and its return values.

type RegistryClient

type RegistryClient struct {
	mock.Mock
}

func NewRegistryClient

func NewRegistryClient() *RegistryClient

func (*RegistryClient) GetManifest

type RegistryClientFactory

type RegistryClientFactory struct {
	mock.Mock
}

func NewRegistryClientFactory

func NewRegistryClientFactory() *RegistryClientFactory

func (*RegistryClientFactory) Get

type Store added in v1.0.1

type Store struct {
	mock.Mock
}

func NewStore added in v1.0.1

func NewStore() *Store

func (*Store) Create added in v1.0.1

func (s *Store) Create(scanJob job.ScanJob) error

func (*Store) Get added in v1.0.1

func (s *Store) Get(scanJobID string) (*job.ScanJob, error)

func (*Store) UpdateReport added in v1.0.1

func (s *Store) UpdateReport(scanJobID string, report harbor.ScanReport) error

func (*Store) UpdateStatus added in v1.0.1

func (s *Store) UpdateStatus(scanJobID string, newStatus job.Status, error ...string) error

type Transformer

type Transformer struct {
	mock.Mock
}

func NewTransformer

func NewTransformer() *Transformer

func (*Transformer) ToClairLayers added in v1.0.1

func (m *Transformer) ToClairLayers(req harbor.ScanRequest, manifest distribution.Manifest) []clair.Layer

func (*Transformer) ToHarborScanReport added in v1.0.1

func (m *Transformer) ToHarborScanReport(artifact harbor.Artifact, layer *clair.Layer) harbor.ScanReport

Jump to

Keyboard shortcuts

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