github.com/projecteru2/core@v0.0.0-20240321043226-06bcc1c23f58/store/etcdv3/meta/mocks/Txn.go (about) 1 // Code generated by mockery v2.31.4. DO NOT EDIT. 2 3 package mocks 4 5 import ( 6 mock "github.com/stretchr/testify/mock" 7 clientv3 "go.etcd.io/etcd/client/v3" 8 ) 9 10 // Txn is an autogenerated mock type for the Txn type 11 type Txn struct { 12 mock.Mock 13 } 14 15 // Commit provides a mock function with given fields: 16 func (_m *Txn) Commit() (*clientv3.TxnResponse, error) { 17 ret := _m.Called() 18 19 var r0 *clientv3.TxnResponse 20 var r1 error 21 if rf, ok := ret.Get(0).(func() (*clientv3.TxnResponse, error)); ok { 22 return rf() 23 } 24 if rf, ok := ret.Get(0).(func() *clientv3.TxnResponse); ok { 25 r0 = rf() 26 } else { 27 if ret.Get(0) != nil { 28 r0 = ret.Get(0).(*clientv3.TxnResponse) 29 } 30 } 31 32 if rf, ok := ret.Get(1).(func() error); ok { 33 r1 = rf() 34 } else { 35 r1 = ret.Error(1) 36 } 37 38 return r0, r1 39 } 40 41 // Else provides a mock function with given fields: ops 42 func (_m *Txn) Else(ops ...clientv3.Op) clientv3.Txn { 43 _va := make([]interface{}, len(ops)) 44 for _i := range ops { 45 _va[_i] = ops[_i] 46 } 47 var _ca []interface{} 48 _ca = append(_ca, _va...) 49 ret := _m.Called(_ca...) 50 51 var r0 clientv3.Txn 52 if rf, ok := ret.Get(0).(func(...clientv3.Op) clientv3.Txn); ok { 53 r0 = rf(ops...) 54 } else { 55 if ret.Get(0) != nil { 56 r0 = ret.Get(0).(clientv3.Txn) 57 } 58 } 59 60 return r0 61 } 62 63 // If provides a mock function with given fields: cs 64 func (_m *Txn) If(cs ...clientv3.Cmp) clientv3.Txn { 65 _va := make([]interface{}, len(cs)) 66 for _i := range cs { 67 _va[_i] = cs[_i] 68 } 69 var _ca []interface{} 70 _ca = append(_ca, _va...) 71 ret := _m.Called(_ca...) 72 73 var r0 clientv3.Txn 74 if rf, ok := ret.Get(0).(func(...clientv3.Cmp) clientv3.Txn); ok { 75 r0 = rf(cs...) 76 } else { 77 if ret.Get(0) != nil { 78 r0 = ret.Get(0).(clientv3.Txn) 79 } 80 } 81 82 return r0 83 } 84 85 // Then provides a mock function with given fields: ops 86 func (_m *Txn) Then(ops ...clientv3.Op) clientv3.Txn { 87 _va := make([]interface{}, len(ops)) 88 for _i := range ops { 89 _va[_i] = ops[_i] 90 } 91 var _ca []interface{} 92 _ca = append(_ca, _va...) 93 ret := _m.Called(_ca...) 94 95 var r0 clientv3.Txn 96 if rf, ok := ret.Get(0).(func(...clientv3.Op) clientv3.Txn); ok { 97 r0 = rf(ops...) 98 } else { 99 if ret.Get(0) != nil { 100 r0 = ret.Get(0).(clientv3.Txn) 101 } 102 } 103 104 return r0 105 } 106 107 // NewTxn creates a new instance of Txn. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 108 // The first argument is typically a *testing.T value. 109 func NewTxn(t interface { 110 mock.TestingT 111 Cleanup(func()) 112 }) *Txn { 113 mock := &Txn{} 114 mock.Mock.Test(t) 115 116 t.Cleanup(func() { mock.AssertExpectations(t) }) 117 118 return mock 119 }