2024-04-11 05:37:59 +02:00
// Code generated by mockery v2.42.2. DO NOT EDIT.
2020-12-08 10:40:03 +01:00
package cache
import (
2022-02-10 08:00:38 +01:00
context "context"
2023-06-29 05:28:19 +02:00
cache "github.com/goharbor/harbor/src/lib/cache"
2020-12-08 10:40:03 +01:00
mock "github.com/stretchr/testify/mock"
2023-06-29 05:28:19 +02:00
time "time"
2020-12-08 10:40:03 +01:00
)
// Cache is an autogenerated mock type for the Cache type
type Cache struct {
mock . Mock
}
2022-02-10 08:00:38 +01:00
// Contains provides a mock function with given fields: ctx, key
func ( _m * Cache ) Contains ( ctx context . Context , key string ) bool {
ret := _m . Called ( ctx , key )
2020-12-08 10:40:03 +01:00
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for Contains" )
}
2020-12-08 10:40:03 +01:00
var r0 bool
2022-02-10 08:00:38 +01:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string ) bool ) ; ok {
r0 = rf ( ctx , key )
2020-12-08 10:40:03 +01:00
} else {
r0 = ret . Get ( 0 ) . ( bool )
}
return r0
}
2022-02-10 08:00:38 +01:00
// Delete provides a mock function with given fields: ctx, key
func ( _m * Cache ) Delete ( ctx context . Context , key string ) error {
ret := _m . Called ( ctx , key )
2020-12-08 10:40:03 +01:00
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for Delete" )
}
2020-12-08 10:40:03 +01:00
var r0 error
2022-02-10 08:00:38 +01:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string ) error ) ; ok {
r0 = rf ( ctx , key )
2020-12-08 10:40:03 +01:00
} else {
r0 = ret . Error ( 0 )
}
return r0
}
2022-02-10 08:00:38 +01:00
// Fetch provides a mock function with given fields: ctx, key, value
func ( _m * Cache ) Fetch ( ctx context . Context , key string , value interface { } ) error {
ret := _m . Called ( ctx , key , value )
2020-12-08 10:40:03 +01:00
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for Fetch" )
}
2020-12-08 10:40:03 +01:00
var r0 error
2022-02-10 08:00:38 +01:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string , interface { } ) error ) ; ok {
r0 = rf ( ctx , key , value )
2020-12-08 10:40:03 +01:00
} else {
r0 = ret . Error ( 0 )
}
return r0
}
2022-02-10 08:00:38 +01:00
// Ping provides a mock function with given fields: ctx
func ( _m * Cache ) Ping ( ctx context . Context ) error {
ret := _m . Called ( ctx )
2020-12-08 10:40:03 +01:00
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for Ping" )
}
2020-12-08 10:40:03 +01:00
var r0 error
2022-02-10 08:00:38 +01:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context ) error ) ; ok {
r0 = rf ( ctx )
2020-12-08 10:40:03 +01:00
} else {
r0 = ret . Error ( 0 )
}
return r0
}
2022-02-10 08:00:38 +01:00
// Save provides a mock function with given fields: ctx, key, value, expiration
func ( _m * Cache ) Save ( ctx context . Context , key string , value interface { } , expiration ... time . Duration ) error {
2020-12-08 10:40:03 +01:00
_va := make ( [ ] interface { } , len ( expiration ) )
for _i := range expiration {
_va [ _i ] = expiration [ _i ]
}
var _ca [ ] interface { }
2022-02-10 08:00:38 +01:00
_ca = append ( _ca , ctx , key , value )
2020-12-08 10:40:03 +01:00
_ca = append ( _ca , _va ... )
ret := _m . Called ( _ca ... )
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for Save" )
}
2020-12-08 10:40:03 +01:00
var r0 error
2022-02-10 08:00:38 +01:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string , interface { } , ... time . Duration ) error ) ; ok {
r0 = rf ( ctx , key , value , expiration ... )
2020-12-08 10:40:03 +01:00
} else {
r0 = ret . Error ( 0 )
}
return r0
}
2022-06-07 10:04:33 +02:00
2023-06-29 05:28:19 +02:00
// Scan provides a mock function with given fields: ctx, match
func ( _m * Cache ) Scan ( ctx context . Context , match string ) ( cache . Iterator , error ) {
ret := _m . Called ( ctx , match )
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for Scan" )
}
2023-06-29 05:28:19 +02:00
var r0 cache . Iterator
var r1 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string ) ( cache . Iterator , error ) ) ; ok {
return rf ( ctx , match )
}
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string ) cache . Iterator ) ; ok {
r0 = rf ( ctx , match )
} else {
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( cache . Iterator )
}
}
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , string ) error ) ; ok {
r1 = rf ( ctx , match )
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2023-11-05 07:37:25 +01:00
// NewCache creates a new instance of Cache. 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 NewCache ( t interface {
2022-06-07 10:04:33 +02:00
mock . TestingT
Cleanup ( func ( ) )
2023-11-05 07:37:25 +01:00
} ) * Cache {
2022-06-07 10:04:33 +02:00
mock := & Cache { }
mock . Mock . Test ( t )
t . Cleanup ( func ( ) { mock . AssertExpectations ( t ) } )
return mock
}