196 lines
6.8 KiB
Go
196 lines
6.8 KiB
Go
// Code generated by MockGen. DO NOT EDIT.
|
|
// Source: client.go
|
|
|
|
// Package mocks is a generated GoMock package.
|
|
package mocks
|
|
|
|
import (
|
|
context "context"
|
|
reflect "reflect"
|
|
|
|
v1 "d7y.io/api/pkg/apis/scheduler/v1"
|
|
dfnet "d7y.io/dragonfly/v2/pkg/dfnet"
|
|
gomock "github.com/golang/mock/gomock"
|
|
grpc "google.golang.org/grpc"
|
|
)
|
|
|
|
// MockClient is a mock of Client interface.
|
|
type MockClient struct {
|
|
ctrl *gomock.Controller
|
|
recorder *MockClientMockRecorder
|
|
}
|
|
|
|
// MockClientMockRecorder is the mock recorder for MockClient.
|
|
type MockClientMockRecorder struct {
|
|
mock *MockClient
|
|
}
|
|
|
|
// NewMockClient creates a new mock instance.
|
|
func NewMockClient(ctrl *gomock.Controller) *MockClient {
|
|
mock := &MockClient{ctrl: ctrl}
|
|
mock.recorder = &MockClientMockRecorder{mock}
|
|
return mock
|
|
}
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
|
func (m *MockClient) EXPECT() *MockClientMockRecorder {
|
|
return m.recorder
|
|
}
|
|
|
|
// AnnounceTask mocks base method.
|
|
func (m *MockClient) AnnounceTask(arg0 context.Context, arg1 *v1.AnnounceTaskRequest, arg2 ...grpc.CallOption) error {
|
|
m.ctrl.T.Helper()
|
|
varargs := []interface{}{arg0, arg1}
|
|
for _, a := range arg2 {
|
|
varargs = append(varargs, a)
|
|
}
|
|
ret := m.ctrl.Call(m, "AnnounceTask", varargs...)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// AnnounceTask indicates an expected call of AnnounceTask.
|
|
func (mr *MockClientMockRecorder) AnnounceTask(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
varargs := append([]interface{}{arg0, arg1}, arg2...)
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AnnounceTask", reflect.TypeOf((*MockClient)(nil).AnnounceTask), varargs...)
|
|
}
|
|
|
|
// Close mocks base method.
|
|
func (m *MockClient) Close() error {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Close")
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// Close indicates an expected call of Close.
|
|
func (mr *MockClientMockRecorder) Close() *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockClient)(nil).Close))
|
|
}
|
|
|
|
// GetState mocks base method.
|
|
func (m *MockClient) GetState() []dfnet.NetAddr {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "GetState")
|
|
ret0, _ := ret[0].([]dfnet.NetAddr)
|
|
return ret0
|
|
}
|
|
|
|
// GetState indicates an expected call of GetState.
|
|
func (mr *MockClientMockRecorder) GetState() *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetState", reflect.TypeOf((*MockClient)(nil).GetState))
|
|
}
|
|
|
|
// LeaveTask mocks base method.
|
|
func (m *MockClient) LeaveTask(arg0 context.Context, arg1 *v1.PeerTarget, arg2 ...grpc.CallOption) error {
|
|
m.ctrl.T.Helper()
|
|
varargs := []interface{}{arg0, arg1}
|
|
for _, a := range arg2 {
|
|
varargs = append(varargs, a)
|
|
}
|
|
ret := m.ctrl.Call(m, "LeaveTask", varargs...)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// LeaveTask indicates an expected call of LeaveTask.
|
|
func (mr *MockClientMockRecorder) LeaveTask(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
varargs := append([]interface{}{arg0, arg1}, arg2...)
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LeaveTask", reflect.TypeOf((*MockClient)(nil).LeaveTask), varargs...)
|
|
}
|
|
|
|
// RegisterPeerTask mocks base method.
|
|
func (m *MockClient) RegisterPeerTask(arg0 context.Context, arg1 *v1.PeerTaskRequest, arg2 ...grpc.CallOption) (*v1.RegisterResult, error) {
|
|
m.ctrl.T.Helper()
|
|
varargs := []interface{}{arg0, arg1}
|
|
for _, a := range arg2 {
|
|
varargs = append(varargs, a)
|
|
}
|
|
ret := m.ctrl.Call(m, "RegisterPeerTask", varargs...)
|
|
ret0, _ := ret[0].(*v1.RegisterResult)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// RegisterPeerTask indicates an expected call of RegisterPeerTask.
|
|
func (mr *MockClientMockRecorder) RegisterPeerTask(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
varargs := append([]interface{}{arg0, arg1}, arg2...)
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterPeerTask", reflect.TypeOf((*MockClient)(nil).RegisterPeerTask), varargs...)
|
|
}
|
|
|
|
// ReportPeerResult mocks base method.
|
|
func (m *MockClient) ReportPeerResult(arg0 context.Context, arg1 *v1.PeerResult, arg2 ...grpc.CallOption) error {
|
|
m.ctrl.T.Helper()
|
|
varargs := []interface{}{arg0, arg1}
|
|
for _, a := range arg2 {
|
|
varargs = append(varargs, a)
|
|
}
|
|
ret := m.ctrl.Call(m, "ReportPeerResult", varargs...)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// ReportPeerResult indicates an expected call of ReportPeerResult.
|
|
func (mr *MockClientMockRecorder) ReportPeerResult(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
varargs := append([]interface{}{arg0, arg1}, arg2...)
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReportPeerResult", reflect.TypeOf((*MockClient)(nil).ReportPeerResult), varargs...)
|
|
}
|
|
|
|
// ReportPieceResult mocks base method.
|
|
func (m *MockClient) ReportPieceResult(arg0 context.Context, arg1 *v1.PeerTaskRequest, arg2 ...grpc.CallOption) (v1.Scheduler_ReportPieceResultClient, error) {
|
|
m.ctrl.T.Helper()
|
|
varargs := []interface{}{arg0, arg1}
|
|
for _, a := range arg2 {
|
|
varargs = append(varargs, a)
|
|
}
|
|
ret := m.ctrl.Call(m, "ReportPieceResult", varargs...)
|
|
ret0, _ := ret[0].(v1.Scheduler_ReportPieceResultClient)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// ReportPieceResult indicates an expected call of ReportPieceResult.
|
|
func (mr *MockClientMockRecorder) ReportPieceResult(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
varargs := append([]interface{}{arg0, arg1}, arg2...)
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReportPieceResult", reflect.TypeOf((*MockClient)(nil).ReportPieceResult), varargs...)
|
|
}
|
|
|
|
// StatTask mocks base method.
|
|
func (m *MockClient) StatTask(arg0 context.Context, arg1 *v1.StatTaskRequest, arg2 ...grpc.CallOption) (*v1.Task, error) {
|
|
m.ctrl.T.Helper()
|
|
varargs := []interface{}{arg0, arg1}
|
|
for _, a := range arg2 {
|
|
varargs = append(varargs, a)
|
|
}
|
|
ret := m.ctrl.Call(m, "StatTask", varargs...)
|
|
ret0, _ := ret[0].(*v1.Task)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// StatTask indicates an expected call of StatTask.
|
|
func (mr *MockClientMockRecorder) StatTask(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
varargs := append([]interface{}{arg0, arg1}, arg2...)
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StatTask", reflect.TypeOf((*MockClient)(nil).StatTask), varargs...)
|
|
}
|
|
|
|
// UpdateState mocks base method.
|
|
func (m *MockClient) UpdateState(arg0 []dfnet.NetAddr) {
|
|
m.ctrl.T.Helper()
|
|
m.ctrl.Call(m, "UpdateState", arg0)
|
|
}
|
|
|
|
// UpdateState indicates an expected call of UpdateState.
|
|
func (mr *MockClientMockRecorder) UpdateState(arg0 interface{}) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateState", reflect.TypeOf((*MockClient)(nil).UpdateState), arg0)
|
|
}
|