-
Notifications
You must be signed in to change notification settings - Fork 262
/
client_mock.go
113 lines (98 loc) · 3.91 KB
/
client_mock.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// Code generated by MockGen. DO NOT EDIT.
// Source: pkg/rpc/dfdaemon/client/client.go
// Package mocks is a generated GoMock package.
package mocks
import (
context "context"
reflect "reflect"
dfnet "d7y.io/dragonfly/v2/internal/dfnet"
base "d7y.io/dragonfly/v2/pkg/rpc/base"
dfdaemon "d7y.io/dragonfly/v2/pkg/rpc/dfdaemon"
client "d7y.io/dragonfly/v2/pkg/rpc/dfdaemon/client"
gomock "github.com/golang/mock/gomock"
grpc "google.golang.org/grpc"
)
// MockDaemonClient is a mock of DaemonClient interface.
type MockDaemonClient struct {
ctrl *gomock.Controller
recorder *MockDaemonClientMockRecorder
}
// MockDaemonClientMockRecorder is the mock recorder for MockDaemonClient.
type MockDaemonClientMockRecorder struct {
mock *MockDaemonClient
}
// NewMockDaemonClient creates a new mock instance.
func NewMockDaemonClient(ctrl *gomock.Controller) *MockDaemonClient {
mock := &MockDaemonClient{ctrl: ctrl}
mock.recorder = &MockDaemonClientMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockDaemonClient) EXPECT() *MockDaemonClientMockRecorder {
return m.recorder
}
// CheckHealth mocks base method.
func (m *MockDaemonClient) CheckHealth(ctx context.Context, target dfnet.NetAddr, opts ...grpc.CallOption) error {
m.ctrl.T.Helper()
varargs := []interface{}{ctx, target}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "CheckHealth", varargs...)
ret0, _ := ret[0].(error)
return ret0
}
// CheckHealth indicates an expected call of CheckHealth.
func (mr *MockDaemonClientMockRecorder) CheckHealth(ctx, target interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{ctx, target}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckHealth", reflect.TypeOf((*MockDaemonClient)(nil).CheckHealth), varargs...)
}
// Close mocks base method.
func (m *MockDaemonClient) 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 *MockDaemonClientMockRecorder) Close() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockDaemonClient)(nil).Close))
}
// Download mocks base method.
func (m *MockDaemonClient) Download(ctx context.Context, req *dfdaemon.DownRequest, opts ...grpc.CallOption) (*client.DownResultStream, error) {
m.ctrl.T.Helper()
varargs := []interface{}{ctx, req}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "Download", varargs...)
ret0, _ := ret[0].(*client.DownResultStream)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Download indicates an expected call of Download.
func (mr *MockDaemonClientMockRecorder) Download(ctx, req interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{ctx, req}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Download", reflect.TypeOf((*MockDaemonClient)(nil).Download), varargs...)
}
// GetPieceTasks mocks base method.
func (m *MockDaemonClient) GetPieceTasks(ctx context.Context, addr dfnet.NetAddr, ptr *base.PieceTaskRequest, opts ...grpc.CallOption) (*base.PiecePacket, error) {
m.ctrl.T.Helper()
varargs := []interface{}{ctx, addr, ptr}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "GetPieceTasks", varargs...)
ret0, _ := ret[0].(*base.PiecePacket)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetPieceTasks indicates an expected call of GetPieceTasks.
func (mr *MockDaemonClientMockRecorder) GetPieceTasks(ctx, addr, ptr interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{ctx, addr, ptr}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPieceTasks", reflect.TypeOf((*MockDaemonClient)(nil).GetPieceTasks), varargs...)
}