etcdclient_mock.go 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. // Code generated by MockGen. DO NOT EDIT.
  2. // Source: etcdclient.go
  3. // Package internal is a generated GoMock package.
  4. package internal
  5. import (
  6. context "context"
  7. gomock "github.com/golang/mock/gomock"
  8. clientv3 "go.etcd.io/etcd/clientv3"
  9. grpc "google.golang.org/grpc"
  10. reflect "reflect"
  11. )
  12. // MockEtcdClient is a mock of EtcdClient interface
  13. type MockEtcdClient struct {
  14. ctrl *gomock.Controller
  15. recorder *MockEtcdClientMockRecorder
  16. }
  17. // MockEtcdClientMockRecorder is the mock recorder for MockEtcdClient
  18. type MockEtcdClientMockRecorder struct {
  19. mock *MockEtcdClient
  20. }
  21. // NewMockEtcdClient creates a new mock instance
  22. func NewMockEtcdClient(ctrl *gomock.Controller) *MockEtcdClient {
  23. mock := &MockEtcdClient{ctrl: ctrl}
  24. mock.recorder = &MockEtcdClientMockRecorder{mock}
  25. return mock
  26. }
  27. // EXPECT returns an object that allows the caller to indicate expected use
  28. func (m *MockEtcdClient) EXPECT() *MockEtcdClientMockRecorder {
  29. return m.recorder
  30. }
  31. // ActiveConnection mocks base method
  32. func (m *MockEtcdClient) ActiveConnection() *grpc.ClientConn {
  33. m.ctrl.T.Helper()
  34. ret := m.ctrl.Call(m, "ActiveConnection")
  35. ret0, _ := ret[0].(*grpc.ClientConn)
  36. return ret0
  37. }
  38. // ActiveConnection indicates an expected call of ActiveConnection
  39. func (mr *MockEtcdClientMockRecorder) ActiveConnection() *gomock.Call {
  40. mr.mock.ctrl.T.Helper()
  41. return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ActiveConnection", reflect.TypeOf((*MockEtcdClient)(nil).ActiveConnection))
  42. }
  43. // Close mocks base method
  44. func (m *MockEtcdClient) Close() error {
  45. m.ctrl.T.Helper()
  46. ret := m.ctrl.Call(m, "Close")
  47. ret0, _ := ret[0].(error)
  48. return ret0
  49. }
  50. // Close indicates an expected call of Close
  51. func (mr *MockEtcdClientMockRecorder) Close() *gomock.Call {
  52. mr.mock.ctrl.T.Helper()
  53. return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockEtcdClient)(nil).Close))
  54. }
  55. // Ctx mocks base method
  56. func (m *MockEtcdClient) Ctx() context.Context {
  57. m.ctrl.T.Helper()
  58. ret := m.ctrl.Call(m, "Ctx")
  59. ret0, _ := ret[0].(context.Context)
  60. return ret0
  61. }
  62. // Ctx indicates an expected call of Ctx
  63. func (mr *MockEtcdClientMockRecorder) Ctx() *gomock.Call {
  64. mr.mock.ctrl.T.Helper()
  65. return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Ctx", reflect.TypeOf((*MockEtcdClient)(nil).Ctx))
  66. }
  67. // Get mocks base method
  68. func (m *MockEtcdClient) Get(ctx context.Context, key string, opts ...clientv3.OpOption) (*clientv3.GetResponse, error) {
  69. m.ctrl.T.Helper()
  70. varargs := []interface{}{ctx, key}
  71. for _, a := range opts {
  72. varargs = append(varargs, a)
  73. }
  74. ret := m.ctrl.Call(m, "Get", varargs...)
  75. ret0, _ := ret[0].(*clientv3.GetResponse)
  76. ret1, _ := ret[1].(error)
  77. return ret0, ret1
  78. }
  79. // Get indicates an expected call of Get
  80. func (mr *MockEtcdClientMockRecorder) Get(ctx, key interface{}, opts ...interface{}) *gomock.Call {
  81. mr.mock.ctrl.T.Helper()
  82. varargs := append([]interface{}{ctx, key}, opts...)
  83. return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockEtcdClient)(nil).Get), varargs...)
  84. }
  85. // Grant mocks base method
  86. func (m *MockEtcdClient) Grant(ctx context.Context, ttl int64) (*clientv3.LeaseGrantResponse, error) {
  87. m.ctrl.T.Helper()
  88. ret := m.ctrl.Call(m, "Grant", ctx, ttl)
  89. ret0, _ := ret[0].(*clientv3.LeaseGrantResponse)
  90. ret1, _ := ret[1].(error)
  91. return ret0, ret1
  92. }
  93. // Grant indicates an expected call of Grant
  94. func (mr *MockEtcdClientMockRecorder) Grant(ctx, ttl interface{}) *gomock.Call {
  95. mr.mock.ctrl.T.Helper()
  96. return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Grant", reflect.TypeOf((*MockEtcdClient)(nil).Grant), ctx, ttl)
  97. }
  98. // KeepAlive mocks base method
  99. func (m *MockEtcdClient) KeepAlive(ctx context.Context, id clientv3.LeaseID) (<-chan *clientv3.LeaseKeepAliveResponse, error) {
  100. m.ctrl.T.Helper()
  101. ret := m.ctrl.Call(m, "KeepAlive", ctx, id)
  102. ret0, _ := ret[0].(<-chan *clientv3.LeaseKeepAliveResponse)
  103. ret1, _ := ret[1].(error)
  104. return ret0, ret1
  105. }
  106. // KeepAlive indicates an expected call of KeepAlive
  107. func (mr *MockEtcdClientMockRecorder) KeepAlive(ctx, id interface{}) *gomock.Call {
  108. mr.mock.ctrl.T.Helper()
  109. return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "KeepAlive", reflect.TypeOf((*MockEtcdClient)(nil).KeepAlive), ctx, id)
  110. }
  111. // Put mocks base method
  112. func (m *MockEtcdClient) Put(ctx context.Context, key, val string, opts ...clientv3.OpOption) (*clientv3.PutResponse, error) {
  113. m.ctrl.T.Helper()
  114. varargs := []interface{}{ctx, key, val}
  115. for _, a := range opts {
  116. varargs = append(varargs, a)
  117. }
  118. ret := m.ctrl.Call(m, "Put", varargs...)
  119. ret0, _ := ret[0].(*clientv3.PutResponse)
  120. ret1, _ := ret[1].(error)
  121. return ret0, ret1
  122. }
  123. // Put indicates an expected call of Put
  124. func (mr *MockEtcdClientMockRecorder) Put(ctx, key, val interface{}, opts ...interface{}) *gomock.Call {
  125. mr.mock.ctrl.T.Helper()
  126. varargs := append([]interface{}{ctx, key, val}, opts...)
  127. return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Put", reflect.TypeOf((*MockEtcdClient)(nil).Put), varargs...)
  128. }
  129. // Revoke mocks base method
  130. func (m *MockEtcdClient) Revoke(ctx context.Context, id clientv3.LeaseID) (*clientv3.LeaseRevokeResponse, error) {
  131. m.ctrl.T.Helper()
  132. ret := m.ctrl.Call(m, "Revoke", ctx, id)
  133. ret0, _ := ret[0].(*clientv3.LeaseRevokeResponse)
  134. ret1, _ := ret[1].(error)
  135. return ret0, ret1
  136. }
  137. // Revoke indicates an expected call of Revoke
  138. func (mr *MockEtcdClientMockRecorder) Revoke(ctx, id interface{}) *gomock.Call {
  139. mr.mock.ctrl.T.Helper()
  140. return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Revoke", reflect.TypeOf((*MockEtcdClient)(nil).Revoke), ctx, id)
  141. }
  142. // Watch mocks base method
  143. func (m *MockEtcdClient) Watch(ctx context.Context, key string, opts ...clientv3.OpOption) clientv3.WatchChan {
  144. m.ctrl.T.Helper()
  145. varargs := []interface{}{ctx, key}
  146. for _, a := range opts {
  147. varargs = append(varargs, a)
  148. }
  149. ret := m.ctrl.Call(m, "Watch", varargs...)
  150. ret0, _ := ret[0].(clientv3.WatchChan)
  151. return ret0
  152. }
  153. // Watch indicates an expected call of Watch
  154. func (mr *MockEtcdClientMockRecorder) Watch(ctx, key interface{}, opts ...interface{}) *gomock.Call {
  155. mr.mock.ctrl.T.Helper()
  156. varargs := append([]interface{}{ctx, key}, opts...)
  157. return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Watch", reflect.TypeOf((*MockEtcdClient)(nil).Watch), varargs...)
  158. }