// Code generated by mockery v2.53.3. DO NOT EDIT.

package redis

import (
	context "context"

	cache "github.com/goharbor/harbor/src/lib/cache"

	mock "github.com/stretchr/testify/mock"
)

// CachedManager is an autogenerated mock type for the CachedManager type
type CachedManager struct {
	mock.Mock
}

// CacheClient provides a mock function with given fields: ctx
func (_m *CachedManager) CacheClient(ctx context.Context) cache.Cache {
	ret := _m.Called(ctx)

	if len(ret) == 0 {
		panic("no return value specified for CacheClient")
	}

	var r0 cache.Cache
	if rf, ok := ret.Get(0).(func(context.Context) cache.Cache); ok {
		r0 = rf(ctx)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(cache.Cache)
		}
	}

	return r0
}

// CountCache provides a mock function with given fields: ctx
func (_m *CachedManager) CountCache(ctx context.Context) (int64, error) {
	ret := _m.Called(ctx)

	if len(ret) == 0 {
		panic("no return value specified for CountCache")
	}

	var r0 int64
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context) (int64, error)); ok {
		return rf(ctx)
	}
	if rf, ok := ret.Get(0).(func(context.Context) int64); ok {
		r0 = rf(ctx)
	} else {
		r0 = ret.Get(0).(int64)
	}

	if rf, ok := ret.Get(1).(func(context.Context) error); ok {
		r1 = rf(ctx)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// Delete provides a mock function with given fields: ctx, digest
func (_m *CachedManager) Delete(ctx context.Context, digest string) error {
	ret := _m.Called(ctx, digest)

	if len(ret) == 0 {
		panic("no return value specified for Delete")
	}

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
		r0 = rf(ctx, digest)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// DeleteCache provides a mock function with given fields: ctx, key
func (_m *CachedManager) DeleteCache(ctx context.Context, key string) error {
	ret := _m.Called(ctx, key)

	if len(ret) == 0 {
		panic("no return value specified for DeleteCache")
	}

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
		r0 = rf(ctx, key)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// FlushAll provides a mock function with given fields: ctx
func (_m *CachedManager) FlushAll(ctx context.Context) error {
	ret := _m.Called(ctx)

	if len(ret) == 0 {
		panic("no return value specified for FlushAll")
	}

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context) error); ok {
		r0 = rf(ctx)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// Get provides a mock function with given fields: ctx, digest
func (_m *CachedManager) Get(ctx context.Context, digest string) ([]byte, error) {
	ret := _m.Called(ctx, digest)

	if len(ret) == 0 {
		panic("no return value specified for Get")
	}

	var r0 []byte
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, string) ([]byte, error)); ok {
		return rf(ctx, digest)
	}
	if rf, ok := ret.Get(0).(func(context.Context, string) []byte); ok {
		r0 = rf(ctx, digest)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]byte)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
		r1 = rf(ctx, digest)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// ResourceType provides a mock function with given fields: ctx
func (_m *CachedManager) ResourceType(ctx context.Context) string {
	ret := _m.Called(ctx)

	if len(ret) == 0 {
		panic("no return value specified for ResourceType")
	}

	var r0 string
	if rf, ok := ret.Get(0).(func(context.Context) string); ok {
		r0 = rf(ctx)
	} else {
		r0 = ret.Get(0).(string)
	}

	return r0
}

// Save provides a mock function with given fields: ctx, digest, manifest
func (_m *CachedManager) Save(ctx context.Context, digest string, manifest []byte) error {
	ret := _m.Called(ctx, digest, manifest)

	if len(ret) == 0 {
		panic("no return value specified for Save")
	}

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, string, []byte) error); ok {
		r0 = rf(ctx, digest, manifest)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// NewCachedManager creates a new instance of CachedManager. 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 NewCachedManager(t interface {
	mock.TestingT
	Cleanup(func())
}) *CachedManager {
	mock := &CachedManager{}
	mock.Mock.Test(t)

	t.Cleanup(func() { mock.AssertExpectations(t) })

	return mock
}
