2024-04-11 05:37:59 +02:00
// Code generated by mockery v2.42.2. DO NOT EDIT.
2020-03-11 15:25:40 +01:00
package blob
import (
context "context"
2020-05-28 12:48:36 +02:00
blob "github.com/goharbor/harbor/src/controller/blob"
2020-03-11 15:25:40 +01:00
distribution "github.com/docker/distribution"
mock "github.com/stretchr/testify/mock"
2020-05-28 12:48:36 +02:00
models "github.com/goharbor/harbor/src/pkg/blob/models"
2021-02-09 10:08:26 +01:00
q "github.com/goharbor/harbor/src/lib/q"
2020-03-11 15:25:40 +01:00
)
// Controller is an autogenerated mock type for the Controller type
type Controller struct {
mock . Mock
}
// AssociateWithArtifact provides a mock function with given fields: ctx, blobDigests, artifactDigest
func ( _m * Controller ) AssociateWithArtifact ( ctx context . Context , blobDigests [ ] string , artifactDigest string ) error {
ret := _m . Called ( ctx , blobDigests , artifactDigest )
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for AssociateWithArtifact" )
}
2020-03-11 15:25:40 +01:00
var r0 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , [ ] string , string ) error ) ; ok {
r0 = rf ( ctx , blobDigests , artifactDigest )
} else {
r0 = ret . Error ( 0 )
}
return r0
}
// AssociateWithProjectByDigest provides a mock function with given fields: ctx, blobDigest, projectID
func ( _m * Controller ) AssociateWithProjectByDigest ( ctx context . Context , blobDigest string , projectID int64 ) error {
ret := _m . Called ( ctx , blobDigest , projectID )
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for AssociateWithProjectByDigest" )
}
2020-03-11 15:25:40 +01:00
var r0 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string , int64 ) error ) ; ok {
r0 = rf ( ctx , blobDigest , projectID )
} else {
r0 = ret . Error ( 0 )
}
return r0
}
// AssociateWithProjectByID provides a mock function with given fields: ctx, blobID, projectID
func ( _m * Controller ) AssociateWithProjectByID ( ctx context . Context , blobID int64 , projectID int64 ) error {
ret := _m . Called ( ctx , blobID , projectID )
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for AssociateWithProjectByID" )
}
2020-03-11 15:25:40 +01:00
var r0 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , int64 , int64 ) error ) ; ok {
r0 = rf ( ctx , blobID , projectID )
} else {
r0 = ret . Error ( 0 )
}
return r0
}
2021-04-29 06:36:25 +02:00
// CalculateTotalSize provides a mock function with given fields: ctx, excludeForeign
func ( _m * Controller ) CalculateTotalSize ( ctx context . Context , excludeForeign bool ) ( int64 , error ) {
ret := _m . Called ( ctx , excludeForeign )
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for CalculateTotalSize" )
}
2021-04-29 06:36:25 +02:00
var r0 int64
2023-03-11 01:16:11 +01:00
var r1 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , bool ) ( int64 , error ) ) ; ok {
return rf ( ctx , excludeForeign )
}
2021-04-29 06:36:25 +02:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , bool ) int64 ) ; ok {
r0 = rf ( ctx , excludeForeign )
} else {
r0 = ret . Get ( 0 ) . ( int64 )
}
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , bool ) error ) ; ok {
r1 = rf ( ctx , excludeForeign )
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2020-03-11 15:25:40 +01:00
// CalculateTotalSizeByProject provides a mock function with given fields: ctx, projectID, excludeForeign
func ( _m * Controller ) CalculateTotalSizeByProject ( ctx context . Context , projectID int64 , excludeForeign bool ) ( int64 , error ) {
ret := _m . Called ( ctx , projectID , excludeForeign )
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for CalculateTotalSizeByProject" )
}
2020-03-11 15:25:40 +01:00
var r0 int64
2023-03-11 01:16:11 +01:00
var r1 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , int64 , bool ) ( int64 , error ) ) ; ok {
return rf ( ctx , projectID , excludeForeign )
}
2020-03-11 15:25:40 +01:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , int64 , bool ) int64 ) ; ok {
r0 = rf ( ctx , projectID , excludeForeign )
} else {
r0 = ret . Get ( 0 ) . ( int64 )
}
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , int64 , bool ) error ) ; ok {
r1 = rf ( ctx , projectID , excludeForeign )
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2020-06-02 06:25:24 +02:00
// Delete provides a mock function with given fields: ctx, id
func ( _m * Controller ) Delete ( ctx context . Context , id int64 ) error {
ret := _m . Called ( ctx , id )
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for Delete" )
}
2020-06-02 06:25:24 +02:00
var r0 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , int64 ) error ) ; ok {
r0 = rf ( ctx , id )
} else {
r0 = ret . Error ( 0 )
}
return r0
}
2020-03-11 15:25:40 +01:00
// Ensure provides a mock function with given fields: ctx, digest, contentType, size
func ( _m * Controller ) Ensure ( ctx context . Context , digest string , contentType string , size int64 ) ( int64 , error ) {
ret := _m . Called ( ctx , digest , contentType , size )
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for Ensure" )
}
2020-03-11 15:25:40 +01:00
var r0 int64
2023-03-11 01:16:11 +01:00
var r1 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string , string , int64 ) ( int64 , error ) ) ; ok {
return rf ( ctx , digest , contentType , size )
}
2020-03-11 15:25:40 +01:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string , string , int64 ) int64 ) ; ok {
r0 = rf ( ctx , digest , contentType , size )
} else {
r0 = ret . Get ( 0 ) . ( int64 )
}
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , string , string , int64 ) error ) ; ok {
r1 = rf ( ctx , digest , contentType , size )
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
// Exist provides a mock function with given fields: ctx, digest, options
func ( _m * Controller ) Exist ( ctx context . Context , digest string , options ... blob . Option ) ( bool , error ) {
_va := make ( [ ] interface { } , len ( options ) )
for _i := range options {
_va [ _i ] = options [ _i ]
}
var _ca [ ] interface { }
_ca = append ( _ca , ctx , digest )
_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 Exist" )
}
2020-03-11 15:25:40 +01:00
var r0 bool
2023-03-11 01:16:11 +01:00
var r1 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string , ... blob . Option ) ( bool , error ) ) ; ok {
return rf ( ctx , digest , options ... )
}
2020-03-11 15:25:40 +01:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string , ... blob . Option ) bool ) ; ok {
r0 = rf ( ctx , digest , options ... )
} else {
r0 = ret . Get ( 0 ) . ( bool )
}
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , string , ... blob . Option ) error ) ; ok {
r1 = rf ( ctx , digest , options ... )
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2020-07-20 05:44:29 +02:00
// Fail provides a mock function with given fields: ctx, _a1
func ( _m * Controller ) Fail ( ctx context . Context , _a1 * models . Blob ) error {
ret := _m . Called ( ctx , _a1 )
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for Fail" )
}
2020-07-20 05:44:29 +02:00
var r0 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * models . Blob ) error ) ; ok {
r0 = rf ( ctx , _a1 )
} else {
r0 = ret . Error ( 0 )
}
return r0
}
2020-03-11 15:25:40 +01:00
// FindMissingAssociationsForProject provides a mock function with given fields: ctx, projectID, blobs
func ( _m * Controller ) FindMissingAssociationsForProject ( ctx context . Context , projectID int64 , blobs [ ] * models . Blob ) ( [ ] * models . Blob , error ) {
ret := _m . Called ( ctx , projectID , blobs )
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for FindMissingAssociationsForProject" )
}
2020-03-11 15:25:40 +01:00
var r0 [ ] * models . Blob
2023-03-11 01:16:11 +01:00
var r1 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , int64 , [ ] * models . Blob ) ( [ ] * models . Blob , error ) ) ; ok {
return rf ( ctx , projectID , blobs )
}
2020-03-11 15:25:40 +01:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , int64 , [ ] * models . Blob ) [ ] * models . Blob ) ; ok {
r0 = rf ( ctx , projectID , blobs )
} else {
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( [ ] * models . Blob )
}
}
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , int64 , [ ] * models . Blob ) error ) ; ok {
r1 = rf ( ctx , projectID , blobs )
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
// Get provides a mock function with given fields: ctx, digest, options
func ( _m * Controller ) Get ( ctx context . Context , digest string , options ... blob . Option ) ( * models . Blob , error ) {
_va := make ( [ ] interface { } , len ( options ) )
for _i := range options {
_va [ _i ] = options [ _i ]
}
var _ca [ ] interface { }
_ca = append ( _ca , ctx , digest )
_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 Get" )
}
2020-03-11 15:25:40 +01:00
var r0 * models . Blob
2023-03-11 01:16:11 +01:00
var r1 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string , ... blob . Option ) ( * models . Blob , error ) ) ; ok {
return rf ( ctx , digest , options ... )
}
2020-03-11 15:25:40 +01:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string , ... blob . Option ) * models . Blob ) ; ok {
r0 = rf ( ctx , digest , options ... )
} else {
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( * models . Blob )
}
}
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , string , ... blob . Option ) error ) ; ok {
r1 = rf ( ctx , digest , options ... )
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2022-02-10 08:00:38 +01:00
// GetAcceptedBlobSize provides a mock function with given fields: ctx, sessionID
func ( _m * Controller ) GetAcceptedBlobSize ( ctx context . Context , sessionID string ) ( int64 , error ) {
ret := _m . Called ( ctx , sessionID )
2020-03-11 15:25:40 +01:00
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for GetAcceptedBlobSize" )
}
2020-03-11 15:25:40 +01:00
var r0 int64
2023-03-11 01:16:11 +01:00
var r1 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string ) ( int64 , error ) ) ; ok {
return rf ( ctx , sessionID )
}
2022-02-10 08:00:38 +01:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string ) int64 ) ; ok {
r0 = rf ( ctx , sessionID )
2020-03-11 15:25:40 +01:00
} else {
r0 = ret . Get ( 0 ) . ( int64 )
}
2022-02-10 08:00:38 +01:00
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , string ) error ) ; ok {
r1 = rf ( ctx , sessionID )
2020-03-11 15:25:40 +01:00
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2021-02-09 10:08:26 +01:00
// List provides a mock function with given fields: ctx, query
func ( _m * Controller ) List ( ctx context . Context , query * q . Query ) ( [ ] * models . Blob , error ) {
ret := _m . Called ( ctx , query )
2020-03-11 15:25:40 +01:00
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for List" )
}
2020-03-11 15:25:40 +01:00
var r0 [ ] * models . Blob
2023-03-11 01:16:11 +01:00
var r1 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * q . Query ) ( [ ] * models . Blob , error ) ) ; ok {
return rf ( ctx , query )
}
2021-02-09 10:08:26 +01:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * q . Query ) [ ] * models . Blob ) ; ok {
r0 = rf ( ctx , query )
2020-03-11 15:25:40 +01:00
} else {
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( [ ] * models . Blob )
}
}
2021-02-09 10:08:26 +01:00
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , * q . Query ) error ) ; ok {
r1 = rf ( ctx , query )
2020-03-11 15:25:40 +01:00
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2022-02-10 08:00:38 +01:00
// SetAcceptedBlobSize provides a mock function with given fields: ctx, sessionID, size
func ( _m * Controller ) SetAcceptedBlobSize ( ctx context . Context , sessionID string , size int64 ) error {
ret := _m . Called ( ctx , sessionID , size )
2020-03-11 15:25:40 +01:00
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for SetAcceptedBlobSize" )
}
2020-03-11 15:25:40 +01:00
var r0 error
2022-02-10 08:00:38 +01:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string , int64 ) error ) ; ok {
r0 = rf ( ctx , sessionID , size )
2020-03-11 15:25:40 +01:00
} else {
r0 = ret . Error ( 0 )
}
return r0
}
// Sync provides a mock function with given fields: ctx, references
func ( _m * Controller ) Sync ( ctx context . Context , references [ ] distribution . Descriptor ) error {
ret := _m . Called ( ctx , references )
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for Sync" )
}
2020-03-11 15:25:40 +01:00
var r0 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , [ ] distribution . Descriptor ) error ) ; ok {
r0 = rf ( ctx , references )
} else {
r0 = ret . Error ( 0 )
}
return r0
}
2020-06-02 06:25:24 +02:00
// Touch provides a mock function with given fields: ctx, _a1
2020-06-23 07:00:29 +02:00
func ( _m * Controller ) Touch ( ctx context . Context , _a1 * models . Blob ) error {
2020-06-02 06:25:24 +02:00
ret := _m . Called ( ctx , _a1 )
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for Touch" )
}
2020-06-23 07:00:29 +02:00
var r0 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * models . Blob ) error ) ; ok {
2020-06-02 06:25:24 +02:00
r0 = rf ( ctx , _a1 )
} else {
2020-06-23 07:00:29 +02:00
r0 = ret . Error ( 0 )
2020-06-02 06:25:24 +02:00
}
2020-06-23 07:00:29 +02:00
return r0
2020-06-02 06:25:24 +02:00
}
// Update provides a mock function with given fields: ctx, _a1
func ( _m * Controller ) Update ( ctx context . Context , _a1 * models . Blob ) error {
ret := _m . Called ( ctx , _a1 )
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for Update" )
}
2020-06-02 06:25:24 +02:00
var r0 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * models . Blob ) error ) ; ok {
r0 = rf ( ctx , _a1 )
} else {
r0 = ret . Error ( 0 )
}
return r0
}
2022-06-07 10:04:33 +02:00
2023-11-05 07:37:25 +01:00
// NewController creates a new instance of Controller. 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 NewController ( t interface {
2022-06-07 10:04:33 +02:00
mock . TestingT
Cleanup ( func ( ) )
2023-11-05 07:37:25 +01:00
} ) * Controller {
2022-06-07 10:04:33 +02:00
mock := & Controller { }
mock . Mock . Test ( t )
t . Cleanup ( func ( ) { mock . AssertExpectations ( t ) } )
return mock
}