mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-22 07:10:41 -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
72 lines
1.8 KiB
Go
72 lines
1.8 KiB
Go
// Code generated by mockery v1.0.0. DO NOT EDIT.
|
|
|
|
package local
|
|
|
|
import digest "github.com/opencontainers/go-digest"
|
|
import mock "github.com/stretchr/testify/mock"
|
|
import types "github.com/aquasecurity/fanal/types"
|
|
|
|
// MockApplier is an autogenerated mock type for the Applier type
|
|
type MockApplier struct {
|
|
mock.Mock
|
|
}
|
|
|
|
type ApplierApplyLayersArgs struct {
|
|
ImageID digest.Digest
|
|
ImageIDAnything bool
|
|
LayerIDs []string
|
|
LayerIDsAnything bool
|
|
}
|
|
|
|
type ApplierApplyLayersReturns struct {
|
|
Detail types.ImageDetail
|
|
Err error
|
|
}
|
|
|
|
type ApplierApplyLayersExpectation struct {
|
|
Args ApplierApplyLayersArgs
|
|
Returns ApplierApplyLayersReturns
|
|
}
|
|
|
|
func (_m *MockApplier) ApplyApplyLayersExpectation(e ApplierApplyLayersExpectation) {
|
|
var args []interface{}
|
|
if e.Args.ImageIDAnything {
|
|
args = append(args, mock.Anything)
|
|
} else {
|
|
args = append(args, e.Args.ImageID)
|
|
}
|
|
if e.Args.LayerIDsAnything {
|
|
args = append(args, mock.Anything)
|
|
} else {
|
|
args = append(args, e.Args.LayerIDs)
|
|
}
|
|
_m.On("ApplyLayers", args...).Return(e.Returns.Detail, e.Returns.Err)
|
|
}
|
|
|
|
func (_m *MockApplier) ApplyApplyLayersExpectations(expectations []ApplierApplyLayersExpectation) {
|
|
for _, e := range expectations {
|
|
_m.ApplyApplyLayersExpectation(e)
|
|
}
|
|
}
|
|
|
|
// ApplyLayers provides a mock function with given fields: imageID, layerIDs
|
|
func (_m *MockApplier) ApplyLayers(imageID digest.Digest, layerIDs []string) (types.ImageDetail, error) {
|
|
ret := _m.Called(imageID, layerIDs)
|
|
|
|
var r0 types.ImageDetail
|
|
if rf, ok := ret.Get(0).(func(digest.Digest, []string) types.ImageDetail); ok {
|
|
r0 = rf(imageID, layerIDs)
|
|
} else {
|
|
r0 = ret.Get(0).(types.ImageDetail)
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(digest.Digest, []string) error); ok {
|
|
r1 = rf(imageID, layerIDs)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|