github.com/turingchain2020/turingchain@v1.1.21/queue/mocks/client.go (about)

     1  // Code generated by mockery v1.0.0. DO NOT EDIT.
     2  
     3  package mocks
     4  
     5  import (
     6  	queue "github.com/turingchain2020/turingchain/queue"
     7  	mock "github.com/stretchr/testify/mock"
     8  
     9  	time "time"
    10  
    11  	types "github.com/turingchain2020/turingchain/types"
    12  )
    13  
    14  // Client is an autogenerated mock type for the Client type
    15  type Client struct {
    16  	mock.Mock
    17  }
    18  
    19  // Close provides a mock function with given fields:
    20  func (_m *Client) Close() {
    21  	_m.Called()
    22  }
    23  
    24  // CloseQueue provides a mock function with given fields:
    25  func (_m *Client) CloseQueue() (*types.Reply, error) {
    26  	ret := _m.Called()
    27  
    28  	var r0 *types.Reply
    29  	if rf, ok := ret.Get(0).(func() *types.Reply); ok {
    30  		r0 = rf()
    31  	} else {
    32  		if ret.Get(0) != nil {
    33  			r0 = ret.Get(0).(*types.Reply)
    34  		}
    35  	}
    36  
    37  	var r1 error
    38  	if rf, ok := ret.Get(1).(func() error); ok {
    39  		r1 = rf()
    40  	} else {
    41  		r1 = ret.Error(1)
    42  	}
    43  
    44  	return r0, r1
    45  }
    46  
    47  // FreeMessage provides a mock function with given fields: msg
    48  func (_m *Client) FreeMessage(msg ...*queue.Message) {
    49  	_va := make([]interface{}, len(msg))
    50  	for _i := range msg {
    51  		_va[_i] = msg[_i]
    52  	}
    53  	var _ca []interface{}
    54  	_ca = append(_ca, _va...)
    55  	_m.Called(_ca...)
    56  }
    57  
    58  // GetConfig provides a mock function with given fields:
    59  func (_m *Client) GetConfig() *types.TuringchainConfig {
    60  	ret := _m.Called()
    61  
    62  	var r0 *types.TuringchainConfig
    63  	if rf, ok := ret.Get(0).(func() *types.TuringchainConfig); ok {
    64  		r0 = rf()
    65  	} else {
    66  		if ret.Get(0) != nil {
    67  			r0 = ret.Get(0).(*types.TuringchainConfig)
    68  		}
    69  	}
    70  
    71  	return r0
    72  }
    73  
    74  // NewMessage provides a mock function with given fields: topic, ty, data
    75  func (_m *Client) NewMessage(topic string, ty int64, data interface{}) *queue.Message {
    76  	ret := _m.Called(topic, ty, data)
    77  
    78  	var r0 *queue.Message
    79  	if rf, ok := ret.Get(0).(func(string, int64, interface{}) *queue.Message); ok {
    80  		r0 = rf(topic, ty, data)
    81  	} else {
    82  		if ret.Get(0) != nil {
    83  			r0 = ret.Get(0).(*queue.Message)
    84  		}
    85  	}
    86  
    87  	return r0
    88  }
    89  
    90  // Recv provides a mock function with given fields:
    91  func (_m *Client) Recv() chan *queue.Message {
    92  	ret := _m.Called()
    93  
    94  	var r0 chan *queue.Message
    95  	if rf, ok := ret.Get(0).(func() chan *queue.Message); ok {
    96  		r0 = rf()
    97  	} else {
    98  		if ret.Get(0) != nil {
    99  			r0 = ret.Get(0).(chan *queue.Message)
   100  		}
   101  	}
   102  
   103  	return r0
   104  }
   105  
   106  // Reply provides a mock function with given fields: msg
   107  func (_m *Client) Reply(msg *queue.Message) {
   108  	_m.Called(msg)
   109  }
   110  
   111  // Send provides a mock function with given fields: msg, waitReply
   112  func (_m *Client) Send(msg *queue.Message, waitReply bool) error {
   113  	ret := _m.Called(msg, waitReply)
   114  
   115  	var r0 error
   116  	if rf, ok := ret.Get(0).(func(*queue.Message, bool) error); ok {
   117  		r0 = rf(msg, waitReply)
   118  	} else {
   119  		r0 = ret.Error(0)
   120  	}
   121  
   122  	return r0
   123  }
   124  
   125  // SendTimeout provides a mock function with given fields: msg, waitReply, timeout
   126  func (_m *Client) SendTimeout(msg *queue.Message, waitReply bool, timeout time.Duration) error {
   127  	ret := _m.Called(msg, waitReply, timeout)
   128  
   129  	var r0 error
   130  	if rf, ok := ret.Get(0).(func(*queue.Message, bool, time.Duration) error); ok {
   131  		r0 = rf(msg, waitReply, timeout)
   132  	} else {
   133  		r0 = ret.Error(0)
   134  	}
   135  
   136  	return r0
   137  }
   138  
   139  // Sub provides a mock function with given fields: topic
   140  func (_m *Client) Sub(topic string) {
   141  	_m.Called(topic)
   142  }
   143  
   144  // Wait provides a mock function with given fields: msg
   145  func (_m *Client) Wait(msg *queue.Message) (*queue.Message, error) {
   146  	ret := _m.Called(msg)
   147  
   148  	var r0 *queue.Message
   149  	if rf, ok := ret.Get(0).(func(*queue.Message) *queue.Message); ok {
   150  		r0 = rf(msg)
   151  	} else {
   152  		if ret.Get(0) != nil {
   153  			r0 = ret.Get(0).(*queue.Message)
   154  		}
   155  	}
   156  
   157  	var r1 error
   158  	if rf, ok := ret.Get(1).(func(*queue.Message) error); ok {
   159  		r1 = rf(msg)
   160  	} else {
   161  		r1 = ret.Error(1)
   162  	}
   163  
   164  	return r0, r1
   165  }
   166  
   167  // WaitTimeout provides a mock function with given fields: msg, timeout
   168  func (_m *Client) WaitTimeout(msg *queue.Message, timeout time.Duration) (*queue.Message, error) {
   169  	ret := _m.Called(msg, timeout)
   170  
   171  	var r0 *queue.Message
   172  	if rf, ok := ret.Get(0).(func(*queue.Message, time.Duration) *queue.Message); ok {
   173  		r0 = rf(msg, timeout)
   174  	} else {
   175  		if ret.Get(0) != nil {
   176  			r0 = ret.Get(0).(*queue.Message)
   177  		}
   178  	}
   179  
   180  	var r1 error
   181  	if rf, ok := ret.Get(1).(func(*queue.Message, time.Duration) error); ok {
   182  		r1 = rf(msg, timeout)
   183  	} else {
   184  		r1 = ret.Error(1)
   185  	}
   186  
   187  	return r0, r1
   188  }