/
messagingClient.go
86 lines (69 loc) · 2.17 KB
/
messagingClient.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
// Code generated by mockery v2.10.0. DO NOT EDIT.
package mocks
import (
time "time"
mock "github.com/stretchr/testify/mock"
)
// MessagingClient is an autogenerated mock type for the messagingClient type
type MessagingClient struct {
mock.Mock
}
// Command provides a mock function with given fields: command, selfID, payload
func (_m MessagingClient) Command(command string, selfID string, payload []byte) ([]byte, error) {
ret := _m.Called(command, selfID, payload)
var r0 []byte
if rf, ok := ret.Get(0).(func(string, string, []byte) []byte); ok {
r0 = rf(command, selfID, payload)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]byte)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(string, string, []byte) error); ok {
r1 = rf(command, selfID, payload)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Request provides a mock function with given fields: recipients, cid, data, timeout
func (_m MessagingClient) Request(recipients []string, cid, mtype string, data []byte, timeout time.Duration) (string, []byte, error) {
ret := _m.Called(recipients, cid, data, timeout)
var r0 string
if rf, ok := ret.Get(0).(func([]string, string, []byte, time.Duration) string); ok {
r0 = rf(recipients, cid, data, timeout)
} else {
r0 = ret.Get(0).(string)
}
var r1 []byte
if rf, ok := ret.Get(1).(func([]string, string, []byte, time.Duration) []byte); ok {
r1 = rf(recipients, cid, data, timeout)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).([]byte)
}
}
var r2 error
if rf, ok := ret.Get(2).(func([]string, string, []byte, time.Duration) error); ok {
r2 = rf(recipients, cid, data, timeout)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// Send provides a mock function with given fields: recipients, data
func (_m MessagingClient) Send(recipients []string, data []byte) error {
ret := _m.Called(recipients, data)
var r0 error
if rf, ok := ret.Get(0).(func([]string, []byte) error); ok {
r0 = rf(recipients, data)
} else {
r0 = ret.Error(0)
}
return r0
}
// Subscribe provides a mock function with given fields: msgType, sub
func (_m MessagingClient) Subscribe(msgType string, sub func(string, []byte)) {
_m.Called(msgType, sub)
}