mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-12 15:50:15 -08:00
* refactor(docker_conf): rename and remove unnecessary options * feat(rpc): define new API * fix(cli): change default timeout * fix(import): fix package names * refactor(vulnerability): remove old mock * refactor(utils): remove un-needed functions * feat(cache): implement cache communicating with a server * refactor(scan): separate scan function as local scanner * test(scanner): add tests for ScanImage * refactor(scan): remove unused options * test(vulnerability): generate mock * refactor(server): split a file * feat(server): implement new RPC server * feat(client): implement new RPC client * fix(cache): use new cache interface * fix(standalone): use new scanner * fix(client): use new scanner * fix(server): pass cache * test(integration): make sure an error is not nil before calling the method * fix(mod): update dependencies * test(integration): ensure the image load finishes * feat(docker): support DOCKER_HOST and DOCKER_CERT_PATH * chore(mod): update dependencies * refactor(rpc): remove old client * feat(server): support old API for backward compatibility * fix(server): check a schema version of JSON cache * fix(rpc): add a version to packages * feat(rpc): add PutImage * test: rename expectations * refactor(cache): rename LayerCache to ImageCache * refactor: rename ImageInfo to ImageReference * fix(applier): pass image_id to ApplyLayer * feat(cache): handle image cache * chore(mod): update dependencies * refactor(server): pass only config * feat(cli): add -removed-pkgs option * refactor(err): wrap errors
65 lines
1.5 KiB
Go
65 lines
1.5 KiB
Go
// Code generated by mockery v1.0.0. DO NOT EDIT.
|
|
|
|
package scanner
|
|
|
|
import context "context"
|
|
import mock "github.com/stretchr/testify/mock"
|
|
import types "github.com/aquasecurity/fanal/types"
|
|
|
|
// MockAnalyzer is an autogenerated mock type for the Analyzer type
|
|
type MockAnalyzer struct {
|
|
mock.Mock
|
|
}
|
|
|
|
type AnalyzerAnalyzeArgs struct {
|
|
Ctx context.Context
|
|
CtxAnything bool
|
|
}
|
|
|
|
type AnalyzerAnalyzeReturns struct {
|
|
Info types.ImageReference
|
|
Err error
|
|
}
|
|
|
|
type AnalyzerAnalyzeExpectation struct {
|
|
Args AnalyzerAnalyzeArgs
|
|
Returns AnalyzerAnalyzeReturns
|
|
}
|
|
|
|
func (_m *MockAnalyzer) ApplyAnalyzeExpectation(e AnalyzerAnalyzeExpectation) {
|
|
var args []interface{}
|
|
if e.Args.CtxAnything {
|
|
args = append(args, mock.Anything)
|
|
} else {
|
|
args = append(args, e.Args.Ctx)
|
|
}
|
|
_m.On("Analyze", args...).Return(e.Returns.Info, e.Returns.Err)
|
|
}
|
|
|
|
func (_m *MockAnalyzer) ApplyAnalyzeExpectations(expectations []AnalyzerAnalyzeExpectation) {
|
|
for _, e := range expectations {
|
|
_m.ApplyAnalyzeExpectation(e)
|
|
}
|
|
}
|
|
|
|
// Analyze provides a mock function with given fields: ctx
|
|
func (_m *MockAnalyzer) Analyze(ctx context.Context) (types.ImageReference, error) {
|
|
ret := _m.Called(ctx)
|
|
|
|
var r0 types.ImageReference
|
|
if rf, ok := ret.Get(0).(func(context.Context) types.ImageReference); ok {
|
|
r0 = rf(ctx)
|
|
} else {
|
|
r0 = ret.Get(0).(types.ImageReference)
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
|
|
r1 = rf(ctx)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|