github.com/koko1123/flow-go-1@v0.29.6/network/mocknetwork/network.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  	irrecoverable "github.com/koko1123/flow-go-1/module/irrecoverable"
    10  
    11  	mock "github.com/stretchr/testify/mock"
    12  
    13  	network "github.com/koko1123/flow-go-1/network"
    14  
    15  	protocol "github.com/libp2p/go-libp2p/core/protocol"
    16  )
    17  
    18  // Network is an autogenerated mock type for the Network type
    19  type Network struct {
    20  	mock.Mock
    21  }
    22  
    23  // Done provides a mock function with given fields:
    24  func (_m *Network) Done() <-chan struct{} {
    25  	ret := _m.Called()
    26  
    27  	var r0 <-chan struct{}
    28  	if rf, ok := ret.Get(0).(func() <-chan struct{}); ok {
    29  		r0 = rf()
    30  	} else {
    31  		if ret.Get(0) != nil {
    32  			r0 = ret.Get(0).(<-chan struct{})
    33  		}
    34  	}
    35  
    36  	return r0
    37  }
    38  
    39  // Ready provides a mock function with given fields:
    40  func (_m *Network) Ready() <-chan struct{} {
    41  	ret := _m.Called()
    42  
    43  	var r0 <-chan struct{}
    44  	if rf, ok := ret.Get(0).(func() <-chan struct{}); ok {
    45  		r0 = rf()
    46  	} else {
    47  		if ret.Get(0) != nil {
    48  			r0 = ret.Get(0).(<-chan struct{})
    49  		}
    50  	}
    51  
    52  	return r0
    53  }
    54  
    55  // Register provides a mock function with given fields: channel, messageProcessor
    56  func (_m *Network) Register(channel channels.Channel, messageProcessor network.MessageProcessor) (network.Conduit, error) {
    57  	ret := _m.Called(channel, messageProcessor)
    58  
    59  	var r0 network.Conduit
    60  	if rf, ok := ret.Get(0).(func(channels.Channel, network.MessageProcessor) network.Conduit); ok {
    61  		r0 = rf(channel, messageProcessor)
    62  	} else {
    63  		if ret.Get(0) != nil {
    64  			r0 = ret.Get(0).(network.Conduit)
    65  		}
    66  	}
    67  
    68  	var r1 error
    69  	if rf, ok := ret.Get(1).(func(channels.Channel, network.MessageProcessor) error); ok {
    70  		r1 = rf(channel, messageProcessor)
    71  	} else {
    72  		r1 = ret.Error(1)
    73  	}
    74  
    75  	return r0, r1
    76  }
    77  
    78  // RegisterBlobService provides a mock function with given fields: channel, store, opts
    79  func (_m *Network) RegisterBlobService(channel channels.Channel, store datastore.Batching, opts ...network.BlobServiceOption) (network.BlobService, error) {
    80  	_va := make([]interface{}, len(opts))
    81  	for _i := range opts {
    82  		_va[_i] = opts[_i]
    83  	}
    84  	var _ca []interface{}
    85  	_ca = append(_ca, channel, store)
    86  	_ca = append(_ca, _va...)
    87  	ret := _m.Called(_ca...)
    88  
    89  	var r0 network.BlobService
    90  	if rf, ok := ret.Get(0).(func(channels.Channel, datastore.Batching, ...network.BlobServiceOption) network.BlobService); ok {
    91  		r0 = rf(channel, store, opts...)
    92  	} else {
    93  		if ret.Get(0) != nil {
    94  			r0 = ret.Get(0).(network.BlobService)
    95  		}
    96  	}
    97  
    98  	var r1 error
    99  	if rf, ok := ret.Get(1).(func(channels.Channel, datastore.Batching, ...network.BlobServiceOption) error); ok {
   100  		r1 = rf(channel, store, opts...)
   101  	} else {
   102  		r1 = ret.Error(1)
   103  	}
   104  
   105  	return r0, r1
   106  }
   107  
   108  // RegisterPingService provides a mock function with given fields: pingProtocolID, pingInfoProvider
   109  func (_m *Network) RegisterPingService(pingProtocolID protocol.ID, pingInfoProvider network.PingInfoProvider) (network.PingService, error) {
   110  	ret := _m.Called(pingProtocolID, pingInfoProvider)
   111  
   112  	var r0 network.PingService
   113  	if rf, ok := ret.Get(0).(func(protocol.ID, network.PingInfoProvider) network.PingService); ok {
   114  		r0 = rf(pingProtocolID, pingInfoProvider)
   115  	} else {
   116  		if ret.Get(0) != nil {
   117  			r0 = ret.Get(0).(network.PingService)
   118  		}
   119  	}
   120  
   121  	var r1 error
   122  	if rf, ok := ret.Get(1).(func(protocol.ID, network.PingInfoProvider) error); ok {
   123  		r1 = rf(pingProtocolID, pingInfoProvider)
   124  	} else {
   125  		r1 = ret.Error(1)
   126  	}
   127  
   128  	return r0, r1
   129  }
   130  
   131  // Start provides a mock function with given fields: _a0
   132  func (_m *Network) Start(_a0 irrecoverable.SignalerContext) {
   133  	_m.Called(_a0)
   134  }
   135  
   136  type mockConstructorTestingTNewNetwork interface {
   137  	mock.TestingT
   138  	Cleanup(func())
   139  }
   140  
   141  // NewNetwork creates a new instance of Network. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
   142  func NewNetwork(t mockConstructorTestingTNewNetwork) *Network {
   143  	mock := &Network{}
   144  	mock.Mock.Test(t)
   145  
   146  	t.Cleanup(func() { mock.AssertExpectations(t) })
   147  
   148  	return mock
   149  }