1
0
mirror of https://github.com/goharbor/harbor synced 2025-04-24 20:58:15 +00:00
harbor/src/testing/pkg/robot/dao/robot_account_dao.go
Wang Yan da52e677e5
remove robot accounts when to delete a project ()
The robots associate with the project should be removed after the project is deleted.

Signed-off-by: wang yan <wangyan@vmware.com>
2020-08-18 10:38:45 +08:00

128 lines
2.7 KiB
Go

// Code generated by mockery v2.1.0. DO NOT EDIT.
package dao
import (
context "context"
mock "github.com/stretchr/testify/mock"
model "github.com/goharbor/harbor/src/pkg/robot/model"
q "github.com/goharbor/harbor/src/lib/q"
)
// RobotAccountDao is an autogenerated mock type for the RobotAccountDao type
type RobotAccountDao struct {
mock.Mock
}
// CreateRobotAccount provides a mock function with given fields: robot
func (_m *RobotAccountDao) CreateRobotAccount(robot *model.Robot) (int64, error) {
ret := _m.Called(robot)
var r0 int64
if rf, ok := ret.Get(0).(func(*model.Robot) int64); ok {
r0 = rf(robot)
} else {
r0 = ret.Get(0).(int64)
}
var r1 error
if rf, ok := ret.Get(1).(func(*model.Robot) error); ok {
r1 = rf(robot)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// DeleteByProjectID provides a mock function with given fields: ctx, projectID
func (_m *RobotAccountDao) DeleteByProjectID(ctx context.Context, projectID int64) error {
ret := _m.Called(ctx, projectID)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, int64) error); ok {
r0 = rf(ctx, projectID)
} else {
r0 = ret.Error(0)
}
return r0
}
// DeleteRobotAccount provides a mock function with given fields: id
func (_m *RobotAccountDao) DeleteRobotAccount(id int64) error {
ret := _m.Called(id)
var r0 error
if rf, ok := ret.Get(0).(func(int64) error); ok {
r0 = rf(id)
} else {
r0 = ret.Error(0)
}
return r0
}
// GetRobotAccount provides a mock function with given fields: id
func (_m *RobotAccountDao) GetRobotAccount(id int64) (*model.Robot, error) {
ret := _m.Called(id)
var r0 *model.Robot
if rf, ok := ret.Get(0).(func(int64) *model.Robot); ok {
r0 = rf(id)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.Robot)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(int64) error); ok {
r1 = rf(id)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ListRobotAccounts provides a mock function with given fields: query
func (_m *RobotAccountDao) ListRobotAccounts(query *q.Query) ([]*model.Robot, error) {
ret := _m.Called(query)
var r0 []*model.Robot
if rf, ok := ret.Get(0).(func(*q.Query) []*model.Robot); ok {
r0 = rf(query)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*model.Robot)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(*q.Query) error); ok {
r1 = rf(query)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// UpdateRobotAccount provides a mock function with given fields: robot
func (_m *RobotAccountDao) UpdateRobotAccount(robot *model.Robot) error {
ret := _m.Called(robot)
var r0 error
if rf, ok := ret.Get(0).(func(*model.Robot) error); ok {
r0 = rf(robot)
} else {
r0 = ret.Error(0)
}
return r0
}