mirror of
https://github.com/goharbor/harbor.git
synced 2024-09-27 13:02:59 +02:00
39ca918ffe
Add REST API to list job pool, worker, stop running task Add jobservice handler to retrieve configuration Add RBAC for jobservice monitoring dashboard Add REST API to list pool, worker and stop running task Signed-off-by: stonezdj <stonezdj@gmail.com> Signed-off-by: stonezdj <stonezdj@gmail.com>
135 lines
2.9 KiB
Go
135 lines
2.9 KiB
Go
// Code generated by mockery v2.14.0. DO NOT EDIT.
|
|
|
|
package task
|
|
|
|
import (
|
|
job "github.com/goharbor/harbor/src/jobservice/job"
|
|
mock "github.com/stretchr/testify/mock"
|
|
|
|
models "github.com/goharbor/harbor/src/common/job/models"
|
|
)
|
|
|
|
// mockJobserviceClient is an autogenerated mock type for the Client type
|
|
type mockJobserviceClient struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// GetExecutions provides a mock function with given fields: uuid
|
|
func (_m *mockJobserviceClient) GetExecutions(uuid string) ([]job.Stats, error) {
|
|
ret := _m.Called(uuid)
|
|
|
|
var r0 []job.Stats
|
|
if rf, ok := ret.Get(0).(func(string) []job.Stats); ok {
|
|
r0 = rf(uuid)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]job.Stats)
|
|
}
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(string) error); ok {
|
|
r1 = rf(uuid)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetJobLog provides a mock function with given fields: uuid
|
|
func (_m *mockJobserviceClient) GetJobLog(uuid string) ([]byte, error) {
|
|
ret := _m.Called(uuid)
|
|
|
|
var r0 []byte
|
|
if rf, ok := ret.Get(0).(func(string) []byte); ok {
|
|
r0 = rf(uuid)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]byte)
|
|
}
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(string) error); ok {
|
|
r1 = rf(uuid)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetJobServiceConfig provides a mock function with given fields:
|
|
func (_m *mockJobserviceClient) GetJobServiceConfig() (*job.Config, error) {
|
|
ret := _m.Called()
|
|
|
|
var r0 *job.Config
|
|
if rf, ok := ret.Get(0).(func() *job.Config); ok {
|
|
r0 = rf()
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*job.Config)
|
|
}
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func() error); ok {
|
|
r1 = rf()
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// PostAction provides a mock function with given fields: uuid, action
|
|
func (_m *mockJobserviceClient) PostAction(uuid string, action string) error {
|
|
ret := _m.Called(uuid, action)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(string, string) error); ok {
|
|
r0 = rf(uuid, action)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// SubmitJob provides a mock function with given fields: _a0
|
|
func (_m *mockJobserviceClient) SubmitJob(_a0 *models.JobData) (string, error) {
|
|
ret := _m.Called(_a0)
|
|
|
|
var r0 string
|
|
if rf, ok := ret.Get(0).(func(*models.JobData) string); ok {
|
|
r0 = rf(_a0)
|
|
} else {
|
|
r0 = ret.Get(0).(string)
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(*models.JobData) error); ok {
|
|
r1 = rf(_a0)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
type mockConstructorTestingTnewMockJobserviceClient interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}
|
|
|
|
// newMockJobserviceClient creates a new instance of mockJobserviceClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
|
func newMockJobserviceClient(t mockConstructorTestingTnewMockJobserviceClient) *mockJobserviceClient {
|
|
mock := &mockJobserviceClient{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|