github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/network/p2p/mock/connector_host.go (about)

     1  // Code generated by mockery v2.21.4. DO NOT EDIT.
     2  
     3  package mockp2p
     4  
     5  import (
     6  	network "github.com/libp2p/go-libp2p/core/network"
     7  	mock "github.com/stretchr/testify/mock"
     8  
     9  	peer "github.com/libp2p/go-libp2p/core/peer"
    10  )
    11  
    12  // ConnectorHost is an autogenerated mock type for the ConnectorHost type
    13  type ConnectorHost struct {
    14  	mock.Mock
    15  }
    16  
    17  // ClosePeer provides a mock function with given fields: peerId
    18  func (_m *ConnectorHost) ClosePeer(peerId peer.ID) error {
    19  	ret := _m.Called(peerId)
    20  
    21  	var r0 error
    22  	if rf, ok := ret.Get(0).(func(peer.ID) error); ok {
    23  		r0 = rf(peerId)
    24  	} else {
    25  		r0 = ret.Error(0)
    26  	}
    27  
    28  	return r0
    29  }
    30  
    31  // Connections provides a mock function with given fields:
    32  func (_m *ConnectorHost) Connections() []network.Conn {
    33  	ret := _m.Called()
    34  
    35  	var r0 []network.Conn
    36  	if rf, ok := ret.Get(0).(func() []network.Conn); ok {
    37  		r0 = rf()
    38  	} else {
    39  		if ret.Get(0) != nil {
    40  			r0 = ret.Get(0).([]network.Conn)
    41  		}
    42  	}
    43  
    44  	return r0
    45  }
    46  
    47  // ID provides a mock function with given fields:
    48  func (_m *ConnectorHost) ID() peer.ID {
    49  	ret := _m.Called()
    50  
    51  	var r0 peer.ID
    52  	if rf, ok := ret.Get(0).(func() peer.ID); ok {
    53  		r0 = rf()
    54  	} else {
    55  		r0 = ret.Get(0).(peer.ID)
    56  	}
    57  
    58  	return r0
    59  }
    60  
    61  // IsConnectedTo provides a mock function with given fields: peerId
    62  func (_m *ConnectorHost) IsConnectedTo(peerId peer.ID) bool {
    63  	ret := _m.Called(peerId)
    64  
    65  	var r0 bool
    66  	if rf, ok := ret.Get(0).(func(peer.ID) bool); ok {
    67  		r0 = rf(peerId)
    68  	} else {
    69  		r0 = ret.Get(0).(bool)
    70  	}
    71  
    72  	return r0
    73  }
    74  
    75  // IsProtected provides a mock function with given fields: peerId
    76  func (_m *ConnectorHost) IsProtected(peerId peer.ID) bool {
    77  	ret := _m.Called(peerId)
    78  
    79  	var r0 bool
    80  	if rf, ok := ret.Get(0).(func(peer.ID) bool); ok {
    81  		r0 = rf(peerId)
    82  	} else {
    83  		r0 = ret.Get(0).(bool)
    84  	}
    85  
    86  	return r0
    87  }
    88  
    89  // PeerInfo provides a mock function with given fields: peerId
    90  func (_m *ConnectorHost) PeerInfo(peerId peer.ID) peer.AddrInfo {
    91  	ret := _m.Called(peerId)
    92  
    93  	var r0 peer.AddrInfo
    94  	if rf, ok := ret.Get(0).(func(peer.ID) peer.AddrInfo); ok {
    95  		r0 = rf(peerId)
    96  	} else {
    97  		r0 = ret.Get(0).(peer.AddrInfo)
    98  	}
    99  
   100  	return r0
   101  }
   102  
   103  type mockConstructorTestingTNewConnectorHost interface {
   104  	mock.TestingT
   105  	Cleanup(func())
   106  }
   107  
   108  // NewConnectorHost creates a new instance of ConnectorHost. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
   109  func NewConnectorHost(t mockConstructorTestingTNewConnectorHost) *ConnectorHost {
   110  	mock := &ConnectorHost{}
   111  	mock.Mock.Test(t)
   112  
   113  	t.Cleanup(func() { mock.AssertExpectations(t) })
   114  
   115  	return mock
   116  }