github.com/koko1123/flow-go-1@v0.29.6/network/p2p/mock/connection_gater.go (about) 1 // Code generated by mockery v2.13.1. DO NOT EDIT. 2 3 package mockp2p 4 5 import ( 6 control "github.com/libp2p/go-libp2p/core/control" 7 mock "github.com/stretchr/testify/mock" 8 9 multiaddr "github.com/multiformats/go-multiaddr" 10 11 network "github.com/libp2p/go-libp2p/core/network" 12 13 peer "github.com/libp2p/go-libp2p/core/peer" 14 ) 15 16 // ConnectionGater is an autogenerated mock type for the ConnectionGater type 17 type ConnectionGater struct { 18 mock.Mock 19 } 20 21 // InterceptAccept provides a mock function with given fields: _a0 22 func (_m *ConnectionGater) InterceptAccept(_a0 network.ConnMultiaddrs) bool { 23 ret := _m.Called(_a0) 24 25 var r0 bool 26 if rf, ok := ret.Get(0).(func(network.ConnMultiaddrs) bool); ok { 27 r0 = rf(_a0) 28 } else { 29 r0 = ret.Get(0).(bool) 30 } 31 32 return r0 33 } 34 35 // InterceptAddrDial provides a mock function with given fields: _a0, _a1 36 func (_m *ConnectionGater) InterceptAddrDial(_a0 peer.ID, _a1 multiaddr.Multiaddr) bool { 37 ret := _m.Called(_a0, _a1) 38 39 var r0 bool 40 if rf, ok := ret.Get(0).(func(peer.ID, multiaddr.Multiaddr) bool); ok { 41 r0 = rf(_a0, _a1) 42 } else { 43 r0 = ret.Get(0).(bool) 44 } 45 46 return r0 47 } 48 49 // InterceptPeerDial provides a mock function with given fields: p 50 func (_m *ConnectionGater) InterceptPeerDial(p peer.ID) bool { 51 ret := _m.Called(p) 52 53 var r0 bool 54 if rf, ok := ret.Get(0).(func(peer.ID) bool); ok { 55 r0 = rf(p) 56 } else { 57 r0 = ret.Get(0).(bool) 58 } 59 60 return r0 61 } 62 63 // InterceptSecured provides a mock function with given fields: _a0, _a1, _a2 64 func (_m *ConnectionGater) InterceptSecured(_a0 network.Direction, _a1 peer.ID, _a2 network.ConnMultiaddrs) bool { 65 ret := _m.Called(_a0, _a1, _a2) 66 67 var r0 bool 68 if rf, ok := ret.Get(0).(func(network.Direction, peer.ID, network.ConnMultiaddrs) bool); ok { 69 r0 = rf(_a0, _a1, _a2) 70 } else { 71 r0 = ret.Get(0).(bool) 72 } 73 74 return r0 75 } 76 77 // InterceptUpgraded provides a mock function with given fields: _a0 78 func (_m *ConnectionGater) InterceptUpgraded(_a0 network.Conn) (bool, control.DisconnectReason) { 79 ret := _m.Called(_a0) 80 81 var r0 bool 82 if rf, ok := ret.Get(0).(func(network.Conn) bool); ok { 83 r0 = rf(_a0) 84 } else { 85 r0 = ret.Get(0).(bool) 86 } 87 88 var r1 control.DisconnectReason 89 if rf, ok := ret.Get(1).(func(network.Conn) control.DisconnectReason); ok { 90 r1 = rf(_a0) 91 } else { 92 r1 = ret.Get(1).(control.DisconnectReason) 93 } 94 95 return r0, r1 96 } 97 98 type mockConstructorTestingTNewConnectionGater interface { 99 mock.TestingT 100 Cleanup(func()) 101 } 102 103 // NewConnectionGater creates a new instance of ConnectionGater. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 104 func NewConnectionGater(t mockConstructorTestingTNewConnectionGater) *ConnectionGater { 105 mock := &ConnectionGater{} 106 mock.Mock.Test(t) 107 108 t.Cleanup(func() { mock.AssertExpectations(t) }) 109 110 return mock 111 }