mock

package
v0.0.0-...-98d65bb Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 6 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) (job.ScanJob, 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, scanJobID string) (*job.ScanJob, error)

func (*Store) UpdateReport

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

func (*Store) UpdateStatus

func (s *Store) UpdateStatus(ctx context.Context, scanJobID string, 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(artifact harbor.Artifact, source []tunnel.Vulnerability) harbor.ScanReport

Jump to

Keyboard shortcuts

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