2020-07-22 03:59:32 +02:00
|
|
|
// Code generated by mockery v2.1.0. DO NOT EDIT.
|
2020-01-22 11:28:08 +01:00
|
|
|
|
|
|
|
package artifact
|
|
|
|
|
|
|
|
import (
|
2020-03-03 09:41:54 +01:00
|
|
|
context "context"
|
2020-02-28 10:19:36 +01:00
|
|
|
|
2020-03-24 13:45:45 +01:00
|
|
|
artifact "github.com/goharbor/harbor/src/controller/artifact"
|
2020-03-03 09:41:54 +01:00
|
|
|
|
|
|
|
mock "github.com/stretchr/testify/mock"
|
|
|
|
|
2020-03-24 13:45:45 +01:00
|
|
|
processor "github.com/goharbor/harbor/src/controller/artifact/processor"
|
2020-03-03 09:41:54 +01:00
|
|
|
|
2020-03-24 13:45:45 +01:00
|
|
|
q "github.com/goharbor/harbor/src/lib/q"
|
2020-03-03 09:41:54 +01:00
|
|
|
|
|
|
|
time "time"
|
2020-01-22 11:28:08 +01:00
|
|
|
)
|
|
|
|
|
2020-03-03 09:41:54 +01:00
|
|
|
// Controller is an autogenerated mock type for the Controller type
|
|
|
|
type Controller struct {
|
2020-01-22 11:28:08 +01:00
|
|
|
mock.Mock
|
|
|
|
}
|
|
|
|
|
2020-03-03 09:41:54 +01:00
|
|
|
// AddLabel provides a mock function with given fields: ctx, artifactID, labelID
|
|
|
|
func (_m *Controller) AddLabel(ctx context.Context, artifactID int64, labelID int64) error {
|
|
|
|
ret := _m.Called(ctx, artifactID, labelID)
|
|
|
|
|
|
|
|
var r0 error
|
|
|
|
if rf, ok := ret.Get(0).(func(context.Context, int64, int64) error); ok {
|
|
|
|
r0 = rf(ctx, artifactID, labelID)
|
|
|
|
} else {
|
|
|
|
r0 = ret.Error(0)
|
|
|
|
}
|
|
|
|
|
|
|
|
return r0
|
2020-01-22 11:28:08 +01:00
|
|
|
}
|
|
|
|
|
2020-03-03 09:41:54 +01:00
|
|
|
// Copy provides a mock function with given fields: ctx, srcRepo, reference, dstRepo
|
|
|
|
func (_m *Controller) Copy(ctx context.Context, srcRepo string, reference string, dstRepo string) (int64, error) {
|
|
|
|
ret := _m.Called(ctx, srcRepo, reference, dstRepo)
|
|
|
|
|
|
|
|
var r0 int64
|
|
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, string, string) int64); ok {
|
|
|
|
r0 = rf(ctx, srcRepo, reference, dstRepo)
|
|
|
|
} else {
|
|
|
|
r0 = ret.Get(0).(int64)
|
|
|
|
}
|
|
|
|
|
|
|
|
var r1 error
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, string, string, string) error); ok {
|
|
|
|
r1 = rf(ctx, srcRepo, reference, dstRepo)
|
|
|
|
} else {
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
}
|
|
|
|
|
|
|
|
return r0, r1
|
2020-02-18 08:51:38 +01:00
|
|
|
}
|
|
|
|
|
2020-03-03 09:41:54 +01:00
|
|
|
// Count provides a mock function with given fields: ctx, query
|
|
|
|
func (_m *Controller) Count(ctx context.Context, query *q.Query) (int64, error) {
|
|
|
|
ret := _m.Called(ctx, query)
|
|
|
|
|
|
|
|
var r0 int64
|
|
|
|
if rf, ok := ret.Get(0).(func(context.Context, *q.Query) int64); ok {
|
|
|
|
r0 = rf(ctx, query)
|
|
|
|
} else {
|
|
|
|
r0 = ret.Get(0).(int64)
|
2020-01-22 11:28:08 +01:00
|
|
|
}
|
2020-03-03 09:41:54 +01:00
|
|
|
|
|
|
|
var r1 error
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, *q.Query) error); ok {
|
|
|
|
r1 = rf(ctx, query)
|
|
|
|
} else {
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
}
|
|
|
|
|
|
|
|
return r0, r1
|
2020-01-22 11:28:08 +01:00
|
|
|
}
|
|
|
|
|
2020-03-03 09:41:54 +01: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)
|
|
|
|
|
|
|
|
var r0 error
|
|
|
|
if rf, ok := ret.Get(0).(func(context.Context, int64) error); ok {
|
|
|
|
r0 = rf(ctx, id)
|
|
|
|
} else {
|
|
|
|
r0 = ret.Error(0)
|
2020-01-22 11:28:08 +01:00
|
|
|
}
|
2020-03-03 09:41:54 +01:00
|
|
|
|
|
|
|
return r0
|
2020-01-22 11:28:08 +01:00
|
|
|
}
|
|
|
|
|
2022-01-17 08:52:14 +01:00
|
|
|
// Ensure provides a mock function with given fields: ctx, repository, digest, option
|
|
|
|
func (_m *Controller) Ensure(ctx context.Context, repository string, digest string, option *artifact.ArtOption) (bool, int64, error) {
|
|
|
|
ret := _m.Called(ctx, repository, digest, option)
|
2020-03-03 09:41:54 +01:00
|
|
|
|
|
|
|
var r0 bool
|
2022-01-17 08:52:14 +01:00
|
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, string, *artifact.ArtOption) bool); ok {
|
|
|
|
r0 = rf(ctx, repository, digest, option)
|
2020-03-03 09:41:54 +01:00
|
|
|
} else {
|
|
|
|
r0 = ret.Get(0).(bool)
|
|
|
|
}
|
|
|
|
|
|
|
|
var r1 int64
|
2022-01-17 08:52:14 +01:00
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, string, string, *artifact.ArtOption) int64); ok {
|
|
|
|
r1 = rf(ctx, repository, digest, option)
|
2020-03-03 09:41:54 +01:00
|
|
|
} else {
|
|
|
|
r1 = ret.Get(1).(int64)
|
|
|
|
}
|
|
|
|
|
|
|
|
var r2 error
|
2022-01-17 08:52:14 +01:00
|
|
|
if rf, ok := ret.Get(2).(func(context.Context, string, string, *artifact.ArtOption) error); ok {
|
|
|
|
r2 = rf(ctx, repository, digest, option)
|
2020-03-03 09:41:54 +01:00
|
|
|
} else {
|
|
|
|
r2 = ret.Error(2)
|
|
|
|
}
|
|
|
|
|
|
|
|
return r0, r1, r2
|
2020-01-22 11:28:08 +01:00
|
|
|
}
|
|
|
|
|
2020-03-03 09:41:54 +01:00
|
|
|
// Get provides a mock function with given fields: ctx, id, option
|
|
|
|
func (_m *Controller) Get(ctx context.Context, id int64, option *artifact.Option) (*artifact.Artifact, error) {
|
|
|
|
ret := _m.Called(ctx, id, option)
|
|
|
|
|
|
|
|
var r0 *artifact.Artifact
|
|
|
|
if rf, ok := ret.Get(0).(func(context.Context, int64, *artifact.Option) *artifact.Artifact); ok {
|
|
|
|
r0 = rf(ctx, id, option)
|
|
|
|
} else {
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
r0 = ret.Get(0).(*artifact.Artifact)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var r1 error
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, int64, *artifact.Option) error); ok {
|
|
|
|
r1 = rf(ctx, id, option)
|
|
|
|
} else {
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
}
|
|
|
|
|
|
|
|
return r0, r1
|
2020-01-22 11:28:08 +01:00
|
|
|
}
|
|
|
|
|
2020-03-03 09:41:54 +01:00
|
|
|
// GetAddition provides a mock function with given fields: ctx, artifactID, additionType
|
2020-03-11 09:20:43 +01:00
|
|
|
func (_m *Controller) GetAddition(ctx context.Context, artifactID int64, additionType string) (*processor.Addition, error) {
|
2020-03-03 09:41:54 +01:00
|
|
|
ret := _m.Called(ctx, artifactID, additionType)
|
|
|
|
|
2020-03-11 09:20:43 +01:00
|
|
|
var r0 *processor.Addition
|
|
|
|
if rf, ok := ret.Get(0).(func(context.Context, int64, string) *processor.Addition); ok {
|
2020-03-03 09:41:54 +01:00
|
|
|
r0 = rf(ctx, artifactID, additionType)
|
|
|
|
} else {
|
|
|
|
if ret.Get(0) != nil {
|
2020-03-11 09:20:43 +01:00
|
|
|
r0 = ret.Get(0).(*processor.Addition)
|
2020-03-03 09:41:54 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var r1 error
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, int64, string) error); ok {
|
|
|
|
r1 = rf(ctx, artifactID, additionType)
|
|
|
|
} else {
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
}
|
|
|
|
|
|
|
|
return r0, r1
|
2020-02-13 09:04:47 +01:00
|
|
|
}
|
|
|
|
|
2020-03-03 09:41:54 +01:00
|
|
|
// GetByReference provides a mock function with given fields: ctx, repository, reference, option
|
|
|
|
func (_m *Controller) GetByReference(ctx context.Context, repository string, reference string, option *artifact.Option) (*artifact.Artifact, error) {
|
|
|
|
ret := _m.Called(ctx, repository, reference, option)
|
|
|
|
|
|
|
|
var r0 *artifact.Artifact
|
|
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, string, *artifact.Option) *artifact.Artifact); ok {
|
|
|
|
r0 = rf(ctx, repository, reference, option)
|
|
|
|
} else {
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
r0 = ret.Get(0).(*artifact.Artifact)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var r1 error
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, string, string, *artifact.Option) error); ok {
|
|
|
|
r1 = rf(ctx, repository, reference, option)
|
|
|
|
} else {
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
}
|
|
|
|
|
|
|
|
return r0, r1
|
2020-01-22 11:28:08 +01:00
|
|
|
}
|
|
|
|
|
2020-03-03 09:41:54 +01:00
|
|
|
// List provides a mock function with given fields: ctx, query, option
|
|
|
|
func (_m *Controller) List(ctx context.Context, query *q.Query, option *artifact.Option) ([]*artifact.Artifact, error) {
|
|
|
|
ret := _m.Called(ctx, query, option)
|
|
|
|
|
|
|
|
var r0 []*artifact.Artifact
|
|
|
|
if rf, ok := ret.Get(0).(func(context.Context, *q.Query, *artifact.Option) []*artifact.Artifact); ok {
|
|
|
|
r0 = rf(ctx, query, option)
|
|
|
|
} else {
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
r0 = ret.Get(0).([]*artifact.Artifact)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var r1 error
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, *q.Query, *artifact.Option) error); ok {
|
|
|
|
r1 = rf(ctx, query, option)
|
|
|
|
} else {
|
|
|
|
r1 = ret.Error(1)
|
2020-01-22 11:28:08 +01:00
|
|
|
}
|
2020-03-03 09:41:54 +01:00
|
|
|
|
|
|
|
return r0, r1
|
2020-01-22 11:28:08 +01:00
|
|
|
}
|
2020-01-27 13:32:14 +01:00
|
|
|
|
2020-03-03 09:41:54 +01:00
|
|
|
// RemoveLabel provides a mock function with given fields: ctx, artifactID, labelID
|
|
|
|
func (_m *Controller) RemoveLabel(ctx context.Context, artifactID int64, labelID int64) error {
|
|
|
|
ret := _m.Called(ctx, artifactID, labelID)
|
|
|
|
|
|
|
|
var r0 error
|
|
|
|
if rf, ok := ret.Get(0).(func(context.Context, int64, int64) error); ok {
|
|
|
|
r0 = rf(ctx, artifactID, labelID)
|
|
|
|
} else {
|
|
|
|
r0 = ret.Error(0)
|
|
|
|
}
|
|
|
|
|
|
|
|
return r0
|
2020-01-27 13:32:14 +01:00
|
|
|
}
|
|
|
|
|
2020-03-03 09:41:54 +01:00
|
|
|
// UpdatePullTime provides a mock function with given fields: ctx, artifactID, tagID, _a3
|
|
|
|
func (_m *Controller) UpdatePullTime(ctx context.Context, artifactID int64, tagID int64, _a3 time.Time) error {
|
|
|
|
ret := _m.Called(ctx, artifactID, tagID, _a3)
|
|
|
|
|
|
|
|
var r0 error
|
|
|
|
if rf, ok := ret.Get(0).(func(context.Context, int64, int64, time.Time) error); ok {
|
|
|
|
r0 = rf(ctx, artifactID, tagID, _a3)
|
|
|
|
} else {
|
|
|
|
r0 = ret.Error(0)
|
|
|
|
}
|
|
|
|
|
|
|
|
return r0
|
2020-01-27 13:32:14 +01:00
|
|
|
}
|
2020-02-28 10:19:36 +01:00
|
|
|
|
2020-03-03 09:41:54 +01:00
|
|
|
// Walk provides a mock function with given fields: ctx, root, walkFn, option
|
|
|
|
func (_m *Controller) Walk(ctx context.Context, root *artifact.Artifact, walkFn func(*artifact.Artifact) error, option *artifact.Option) error {
|
|
|
|
ret := _m.Called(ctx, root, walkFn, option)
|
|
|
|
|
|
|
|
var r0 error
|
|
|
|
if rf, ok := ret.Get(0).(func(context.Context, *artifact.Artifact, func(*artifact.Artifact) error, *artifact.Option) error); ok {
|
|
|
|
r0 = rf(ctx, root, walkFn, option)
|
|
|
|
} else {
|
|
|
|
r0 = ret.Error(0)
|
|
|
|
}
|
|
|
|
|
|
|
|
return r0
|
2020-02-28 10:19:36 +01:00
|
|
|
}
|