summaryrefslogtreecommitdiff
path: root/registry-scanner/pkg/registry/mocks/ManifestService.go
diff options
context:
space:
mode:
Diffstat (limited to 'registry-scanner/pkg/registry/mocks/ManifestService.go')
-rw-r--r--registry-scanner/pkg/registry/mocks/ManifestService.go149
1 files changed, 149 insertions, 0 deletions
diff --git a/registry-scanner/pkg/registry/mocks/ManifestService.go b/registry-scanner/pkg/registry/mocks/ManifestService.go
new file mode 100644
index 0000000..cb42e32
--- /dev/null
+++ b/registry-scanner/pkg/registry/mocks/ManifestService.go
@@ -0,0 +1,149 @@
+// Code generated by mockery v2.43.2. DO NOT EDIT.
+
+package mocks
+
+import (
+ context "context"
+
+ distribution "github.com/distribution/distribution/v3"
+ digest "github.com/opencontainers/go-digest"
+
+ mock "github.com/stretchr/testify/mock"
+)
+
+// ManifestService is an autogenerated mock type for the ManifestService type
+type ManifestService struct {
+ mock.Mock
+}
+
+// Delete provides a mock function with given fields: ctx, dgst
+func (_m *ManifestService) Delete(ctx context.Context, dgst digest.Digest) error {
+ ret := _m.Called(ctx, dgst)
+
+ if len(ret) == 0 {
+ panic("no return value specified for Delete")
+ }
+
+ var r0 error
+ if rf, ok := ret.Get(0).(func(context.Context, digest.Digest) error); ok {
+ r0 = rf(ctx, dgst)
+ } else {
+ r0 = ret.Error(0)
+ }
+
+ return r0
+}
+
+// Exists provides a mock function with given fields: ctx, dgst
+func (_m *ManifestService) Exists(ctx context.Context, dgst digest.Digest) (bool, error) {
+ ret := _m.Called(ctx, dgst)
+
+ if len(ret) == 0 {
+ panic("no return value specified for Exists")
+ }
+
+ var r0 bool
+ var r1 error
+ if rf, ok := ret.Get(0).(func(context.Context, digest.Digest) (bool, error)); ok {
+ return rf(ctx, dgst)
+ }
+ if rf, ok := ret.Get(0).(func(context.Context, digest.Digest) bool); ok {
+ r0 = rf(ctx, dgst)
+ } else {
+ r0 = ret.Get(0).(bool)
+ }
+
+ if rf, ok := ret.Get(1).(func(context.Context, digest.Digest) error); ok {
+ r1 = rf(ctx, dgst)
+ } else {
+ r1 = ret.Error(1)
+ }
+
+ return r0, r1
+}
+
+// Get provides a mock function with given fields: ctx, dgst, options
+func (_m *ManifestService) Get(ctx context.Context, dgst digest.Digest, options ...distribution.ManifestServiceOption) (distribution.Manifest, error) {
+ _va := make([]interface{}, len(options))
+ for _i := range options {
+ _va[_i] = options[_i]
+ }
+ var _ca []interface{}
+ _ca = append(_ca, ctx, dgst)
+ _ca = append(_ca, _va...)
+ ret := _m.Called(_ca...)
+
+ if len(ret) == 0 {
+ panic("no return value specified for Get")
+ }
+
+ var r0 distribution.Manifest
+ var r1 error
+ if rf, ok := ret.Get(0).(func(context.Context, digest.Digest, ...distribution.ManifestServiceOption) (distribution.Manifest, error)); ok {
+ return rf(ctx, dgst, options...)
+ }
+ if rf, ok := ret.Get(0).(func(context.Context, digest.Digest, ...distribution.ManifestServiceOption) distribution.Manifest); ok {
+ r0 = rf(ctx, dgst, options...)
+ } else {
+ if ret.Get(0) != nil {
+ r0 = ret.Get(0).(distribution.Manifest)
+ }
+ }
+
+ if rf, ok := ret.Get(1).(func(context.Context, digest.Digest, ...distribution.ManifestServiceOption) error); ok {
+ r1 = rf(ctx, dgst, options...)
+ } else {
+ r1 = ret.Error(1)
+ }
+
+ return r0, r1
+}
+
+// Put provides a mock function with given fields: ctx, manifest, options
+func (_m *ManifestService) Put(ctx context.Context, manifest distribution.Manifest, options ...distribution.ManifestServiceOption) (digest.Digest, error) {
+ _va := make([]interface{}, len(options))
+ for _i := range options {
+ _va[_i] = options[_i]
+ }
+ var _ca []interface{}
+ _ca = append(_ca, ctx, manifest)
+ _ca = append(_ca, _va...)
+ ret := _m.Called(_ca...)
+
+ if len(ret) == 0 {
+ panic("no return value specified for Put")
+ }
+
+ var r0 digest.Digest
+ var r1 error
+ if rf, ok := ret.Get(0).(func(context.Context, distribution.Manifest, ...distribution.ManifestServiceOption) (digest.Digest, error)); ok {
+ return rf(ctx, manifest, options...)
+ }
+ if rf, ok := ret.Get(0).(func(context.Context, distribution.Manifest, ...distribution.ManifestServiceOption) digest.Digest); ok {
+ r0 = rf(ctx, manifest, options...)
+ } else {
+ r0 = ret.Get(0).(digest.Digest)
+ }
+
+ if rf, ok := ret.Get(1).(func(context.Context, distribution.Manifest, ...distribution.ManifestServiceOption) error); ok {
+ r1 = rf(ctx, manifest, options...)
+ } else {
+ r1 = ret.Error(1)
+ }
+
+ return r0, r1
+}
+
+// NewManifestService creates a new instance of ManifestService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
+// The first argument is typically a *testing.T value.
+func NewManifestService(t interface {
+ mock.TestingT
+ Cleanup(func())
+}) *ManifestService {
+ mock := &ManifestService{}
+ mock.Mock.Test(t)
+
+ t.Cleanup(func() { mock.AssertExpectations(t) })
+
+ return mock
+}