github.com/koko1123/flow-go-1@v0.29.6/network/mocknetwork/middleware.go (about)

     1  // Code generated by mockery v2.13.1. DO NOT EDIT.
     2  
     3  package mocknetwork
     4  
     5  import (
     6  	datastore "github.com/ipfs/go-datastore"
     7  	channels "github.com/koko1123/flow-go-1/network/channels"
     8  
     9  	flow "github.com/koko1123/flow-go-1/model/flow"
    10  
    11  	irrecoverable "github.com/koko1123/flow-go-1/module/irrecoverable"
    12  
    13  	mock "github.com/stretchr/testify/mock"
    14  
    15  	network "github.com/koko1123/flow-go-1/network"
    16  
    17  	protocol "github.com/libp2p/go-libp2p/core/protocol"
    18  )
    19  
    20  // Middleware is an autogenerated mock type for the Middleware type
    21  type Middleware struct {
    22  	mock.Mock
    23  }
    24  
    25  // Done provides a mock function with given fields:
    26  func (_m *Middleware) Done() <-chan struct{} {
    27  	ret := _m.Called()
    28  
    29  	var r0 <-chan struct{}
    30  	if rf, ok := ret.Get(0).(func() <-chan struct{}); ok {
    31  		r0 = rf()
    32  	} else {
    33  		if ret.Get(0) != nil {
    34  			r0 = ret.Get(0).(<-chan struct{})
    35  		}
    36  	}
    37  
    38  	return r0
    39  }
    40  
    41  // IsConnected provides a mock function with given fields: nodeID
    42  func (_m *Middleware) IsConnected(nodeID flow.Identifier) (bool, error) {
    43  	ret := _m.Called(nodeID)
    44  
    45  	var r0 bool
    46  	if rf, ok := ret.Get(0).(func(flow.Identifier) bool); ok {
    47  		r0 = rf(nodeID)
    48  	} else {
    49  		r0 = ret.Get(0).(bool)
    50  	}
    51  
    52  	var r1 error
    53  	if rf, ok := ret.Get(1).(func(flow.Identifier) error); ok {
    54  		r1 = rf(nodeID)
    55  	} else {
    56  		r1 = ret.Error(1)
    57  	}
    58  
    59  	return r0, r1
    60  }
    61  
    62  // NewBlobService provides a mock function with given fields: channel, store, opts
    63  func (_m *Middleware) NewBlobService(channel channels.Channel, store datastore.Batching, opts ...network.BlobServiceOption) network.BlobService {
    64  	_va := make([]interface{}, len(opts))
    65  	for _i := range opts {
    66  		_va[_i] = opts[_i]
    67  	}
    68  	var _ca []interface{}
    69  	_ca = append(_ca, channel, store)
    70  	_ca = append(_ca, _va...)
    71  	ret := _m.Called(_ca...)
    72  
    73  	var r0 network.BlobService
    74  	if rf, ok := ret.Get(0).(func(channels.Channel, datastore.Batching, ...network.BlobServiceOption) network.BlobService); ok {
    75  		r0 = rf(channel, store, opts...)
    76  	} else {
    77  		if ret.Get(0) != nil {
    78  			r0 = ret.Get(0).(network.BlobService)
    79  		}
    80  	}
    81  
    82  	return r0
    83  }
    84  
    85  // NewPingService provides a mock function with given fields: pingProtocol, provider
    86  func (_m *Middleware) NewPingService(pingProtocol protocol.ID, provider network.PingInfoProvider) network.PingService {
    87  	ret := _m.Called(pingProtocol, provider)
    88  
    89  	var r0 network.PingService
    90  	if rf, ok := ret.Get(0).(func(protocol.ID, network.PingInfoProvider) network.PingService); ok {
    91  		r0 = rf(pingProtocol, provider)
    92  	} else {
    93  		if ret.Get(0) != nil {
    94  			r0 = ret.Get(0).(network.PingService)
    95  		}
    96  	}
    97  
    98  	return r0
    99  }
   100  
   101  // Publish provides a mock function with given fields: msg
   102  func (_m *Middleware) Publish(msg *network.OutgoingMessageScope) error {
   103  	ret := _m.Called(msg)
   104  
   105  	var r0 error
   106  	if rf, ok := ret.Get(0).(func(*network.OutgoingMessageScope) error); ok {
   107  		r0 = rf(msg)
   108  	} else {
   109  		r0 = ret.Error(0)
   110  	}
   111  
   112  	return r0
   113  }
   114  
   115  // Ready provides a mock function with given fields:
   116  func (_m *Middleware) Ready() <-chan struct{} {
   117  	ret := _m.Called()
   118  
   119  	var r0 <-chan struct{}
   120  	if rf, ok := ret.Get(0).(func() <-chan struct{}); ok {
   121  		r0 = rf()
   122  	} else {
   123  		if ret.Get(0) != nil {
   124  			r0 = ret.Get(0).(<-chan struct{})
   125  		}
   126  	}
   127  
   128  	return r0
   129  }
   130  
   131  // SendDirect provides a mock function with given fields: msg
   132  func (_m *Middleware) SendDirect(msg *network.OutgoingMessageScope) error {
   133  	ret := _m.Called(msg)
   134  
   135  	var r0 error
   136  	if rf, ok := ret.Get(0).(func(*network.OutgoingMessageScope) error); ok {
   137  		r0 = rf(msg)
   138  	} else {
   139  		r0 = ret.Error(0)
   140  	}
   141  
   142  	return r0
   143  }
   144  
   145  // SetOverlay provides a mock function with given fields: _a0
   146  func (_m *Middleware) SetOverlay(_a0 network.Overlay) {
   147  	_m.Called(_a0)
   148  }
   149  
   150  // Start provides a mock function with given fields: _a0
   151  func (_m *Middleware) Start(_a0 irrecoverable.SignalerContext) {
   152  	_m.Called(_a0)
   153  }
   154  
   155  // Subscribe provides a mock function with given fields: channel
   156  func (_m *Middleware) Subscribe(channel channels.Channel) error {
   157  	ret := _m.Called(channel)
   158  
   159  	var r0 error
   160  	if rf, ok := ret.Get(0).(func(channels.Channel) error); ok {
   161  		r0 = rf(channel)
   162  	} else {
   163  		r0 = ret.Error(0)
   164  	}
   165  
   166  	return r0
   167  }
   168  
   169  // Unsubscribe provides a mock function with given fields: channel
   170  func (_m *Middleware) Unsubscribe(channel channels.Channel) error {
   171  	ret := _m.Called(channel)
   172  
   173  	var r0 error
   174  	if rf, ok := ret.Get(0).(func(channels.Channel) error); ok {
   175  		r0 = rf(channel)
   176  	} else {
   177  		r0 = ret.Error(0)
   178  	}
   179  
   180  	return r0
   181  }
   182  
   183  // UpdateNodeAddresses provides a mock function with given fields:
   184  func (_m *Middleware) UpdateNodeAddresses() {
   185  	_m.Called()
   186  }
   187  
   188  type mockConstructorTestingTNewMiddleware interface {
   189  	mock.TestingT
   190  	Cleanup(func())
   191  }
   192  
   193  // NewMiddleware creates a new instance of Middleware. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
   194  func NewMiddleware(t mockConstructorTestingTNewMiddleware) *Middleware {
   195  	mock := &Middleware{}
   196  	mock.Mock.Test(t)
   197  
   198  	t.Cleanup(func() { mock.AssertExpectations(t) })
   199  
   200  	return mock
   201  }