mock

package
v0.31.4 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const Anything = mock.Anything

Variables

This section is empty.

Functions

func ApplyExpectations

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

ApplyExpectations applies the specified expectations on a given mock.

Types

type Enqueuer

type Enqueuer struct {
	mock.Mock
}

func NewEnqueuer

func NewEnqueuer() *Enqueuer

func (*Enqueuer) Enqueue

func (em *Enqueuer) Enqueue(ctx context.Context, 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 Store

type Store struct {
	mock.Mock
}

func NewStore

func NewStore() *Store

func (*Store) Create

func (s *Store) Create(ctx context.Context, scanJob job.ScanJob) error

func (*Store) Get

func (s *Store) Get(ctx context.Context, scanJobKey job.ScanJobKey) (*job.ScanJob, error)

func (*Store) UpdateReport

func (s *Store) UpdateReport(ctx context.Context, scanJobKey job.ScanJobKey, report harbor.ScanReport) error

func (*Store) UpdateStatus

func (s *Store) UpdateStatus(ctx context.Context, scanJobKey job.ScanJobKey, newStatus job.ScanJobStatus, error ...string) error

type Transformer

type Transformer struct {
	mock.Mock
}

func NewTransformer

func NewTransformer() *Transformer

func (*Transformer) Transform

func (t *Transformer) Transform(mediaType api.MediaType, req harbor.ScanRequest, source trivy.Report) harbor.ScanReport

Jump to

Keyboard shortcuts

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