github.com/koko1123/flow-go-1@v0.29.6/module/mock/tracer.go (about) 1 // Code generated by mockery v2.13.1. DO NOT EDIT. 2 3 package mock 4 5 import ( 6 context "context" 7 8 flow "github.com/koko1123/flow-go-1/model/flow" 9 mock "github.com/stretchr/testify/mock" 10 11 oteltrace "go.opentelemetry.io/otel/trace" 12 13 trace "github.com/koko1123/flow-go-1/module/trace" 14 ) 15 16 // Tracer is an autogenerated mock type for the Tracer type 17 type Tracer struct { 18 mock.Mock 19 } 20 21 // Done provides a mock function with given fields: 22 func (_m *Tracer) Done() <-chan struct{} { 23 ret := _m.Called() 24 25 var r0 <-chan struct{} 26 if rf, ok := ret.Get(0).(func() <-chan struct{}); ok { 27 r0 = rf() 28 } else { 29 if ret.Get(0) != nil { 30 r0 = ret.Get(0).(<-chan struct{}) 31 } 32 } 33 34 return r0 35 } 36 37 // Ready provides a mock function with given fields: 38 func (_m *Tracer) Ready() <-chan struct{} { 39 ret := _m.Called() 40 41 var r0 <-chan struct{} 42 if rf, ok := ret.Get(0).(func() <-chan struct{}); ok { 43 r0 = rf() 44 } else { 45 if ret.Get(0) != nil { 46 r0 = ret.Get(0).(<-chan struct{}) 47 } 48 } 49 50 return r0 51 } 52 53 // StartBlockSpan provides a mock function with given fields: ctx, blockID, spanName, opts 54 func (_m *Tracer) StartBlockSpan(ctx context.Context, blockID flow.Identifier, spanName trace.SpanName, opts ...oteltrace.SpanStartOption) (oteltrace.Span, context.Context) { 55 _va := make([]interface{}, len(opts)) 56 for _i := range opts { 57 _va[_i] = opts[_i] 58 } 59 var _ca []interface{} 60 _ca = append(_ca, ctx, blockID, spanName) 61 _ca = append(_ca, _va...) 62 ret := _m.Called(_ca...) 63 64 var r0 oteltrace.Span 65 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier, trace.SpanName, ...oteltrace.SpanStartOption) oteltrace.Span); ok { 66 r0 = rf(ctx, blockID, spanName, opts...) 67 } else { 68 if ret.Get(0) != nil { 69 r0 = ret.Get(0).(oteltrace.Span) 70 } 71 } 72 73 var r1 context.Context 74 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier, trace.SpanName, ...oteltrace.SpanStartOption) context.Context); ok { 75 r1 = rf(ctx, blockID, spanName, opts...) 76 } else { 77 if ret.Get(1) != nil { 78 r1 = ret.Get(1).(context.Context) 79 } 80 } 81 82 return r0, r1 83 } 84 85 // StartCollectionSpan provides a mock function with given fields: ctx, collectionID, spanName, opts 86 func (_m *Tracer) StartCollectionSpan(ctx context.Context, collectionID flow.Identifier, spanName trace.SpanName, opts ...oteltrace.SpanStartOption) (oteltrace.Span, context.Context) { 87 _va := make([]interface{}, len(opts)) 88 for _i := range opts { 89 _va[_i] = opts[_i] 90 } 91 var _ca []interface{} 92 _ca = append(_ca, ctx, collectionID, spanName) 93 _ca = append(_ca, _va...) 94 ret := _m.Called(_ca...) 95 96 var r0 oteltrace.Span 97 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier, trace.SpanName, ...oteltrace.SpanStartOption) oteltrace.Span); ok { 98 r0 = rf(ctx, collectionID, spanName, opts...) 99 } else { 100 if ret.Get(0) != nil { 101 r0 = ret.Get(0).(oteltrace.Span) 102 } 103 } 104 105 var r1 context.Context 106 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier, trace.SpanName, ...oteltrace.SpanStartOption) context.Context); ok { 107 r1 = rf(ctx, collectionID, spanName, opts...) 108 } else { 109 if ret.Get(1) != nil { 110 r1 = ret.Get(1).(context.Context) 111 } 112 } 113 114 return r0, r1 115 } 116 117 // StartSpanFromContext provides a mock function with given fields: ctx, operationName, opts 118 func (_m *Tracer) StartSpanFromContext(ctx context.Context, operationName trace.SpanName, opts ...oteltrace.SpanStartOption) (oteltrace.Span, context.Context) { 119 _va := make([]interface{}, len(opts)) 120 for _i := range opts { 121 _va[_i] = opts[_i] 122 } 123 var _ca []interface{} 124 _ca = append(_ca, ctx, operationName) 125 _ca = append(_ca, _va...) 126 ret := _m.Called(_ca...) 127 128 var r0 oteltrace.Span 129 if rf, ok := ret.Get(0).(func(context.Context, trace.SpanName, ...oteltrace.SpanStartOption) oteltrace.Span); ok { 130 r0 = rf(ctx, operationName, opts...) 131 } else { 132 if ret.Get(0) != nil { 133 r0 = ret.Get(0).(oteltrace.Span) 134 } 135 } 136 137 var r1 context.Context 138 if rf, ok := ret.Get(1).(func(context.Context, trace.SpanName, ...oteltrace.SpanStartOption) context.Context); ok { 139 r1 = rf(ctx, operationName, opts...) 140 } else { 141 if ret.Get(1) != nil { 142 r1 = ret.Get(1).(context.Context) 143 } 144 } 145 146 return r0, r1 147 } 148 149 // StartSpanFromParent provides a mock function with given fields: parentSpan, operationName, opts 150 func (_m *Tracer) StartSpanFromParent(parentSpan oteltrace.Span, operationName trace.SpanName, opts ...oteltrace.SpanStartOption) oteltrace.Span { 151 _va := make([]interface{}, len(opts)) 152 for _i := range opts { 153 _va[_i] = opts[_i] 154 } 155 var _ca []interface{} 156 _ca = append(_ca, parentSpan, operationName) 157 _ca = append(_ca, _va...) 158 ret := _m.Called(_ca...) 159 160 var r0 oteltrace.Span 161 if rf, ok := ret.Get(0).(func(oteltrace.Span, trace.SpanName, ...oteltrace.SpanStartOption) oteltrace.Span); ok { 162 r0 = rf(parentSpan, operationName, opts...) 163 } else { 164 if ret.Get(0) != nil { 165 r0 = ret.Get(0).(oteltrace.Span) 166 } 167 } 168 169 return r0 170 } 171 172 // StartTransactionSpan provides a mock function with given fields: ctx, transactionID, spanName, opts 173 func (_m *Tracer) StartTransactionSpan(ctx context.Context, transactionID flow.Identifier, spanName trace.SpanName, opts ...oteltrace.SpanStartOption) (oteltrace.Span, context.Context) { 174 _va := make([]interface{}, len(opts)) 175 for _i := range opts { 176 _va[_i] = opts[_i] 177 } 178 var _ca []interface{} 179 _ca = append(_ca, ctx, transactionID, spanName) 180 _ca = append(_ca, _va...) 181 ret := _m.Called(_ca...) 182 183 var r0 oteltrace.Span 184 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier, trace.SpanName, ...oteltrace.SpanStartOption) oteltrace.Span); ok { 185 r0 = rf(ctx, transactionID, spanName, opts...) 186 } else { 187 if ret.Get(0) != nil { 188 r0 = ret.Get(0).(oteltrace.Span) 189 } 190 } 191 192 var r1 context.Context 193 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier, trace.SpanName, ...oteltrace.SpanStartOption) context.Context); ok { 194 r1 = rf(ctx, transactionID, spanName, opts...) 195 } else { 196 if ret.Get(1) != nil { 197 r1 = ret.Get(1).(context.Context) 198 } 199 } 200 201 return r0, r1 202 } 203 204 // WithSpanFromContext provides a mock function with given fields: ctx, operationName, f, opts 205 func (_m *Tracer) WithSpanFromContext(ctx context.Context, operationName trace.SpanName, f func(), opts ...oteltrace.SpanStartOption) { 206 _va := make([]interface{}, len(opts)) 207 for _i := range opts { 208 _va[_i] = opts[_i] 209 } 210 var _ca []interface{} 211 _ca = append(_ca, ctx, operationName, f) 212 _ca = append(_ca, _va...) 213 _m.Called(_ca...) 214 } 215 216 type mockConstructorTestingTNewTracer interface { 217 mock.TestingT 218 Cleanup(func()) 219 } 220 221 // NewTracer creates a new instance of Tracer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 222 func NewTracer(t mockConstructorTestingTNewTracer) *Tracer { 223 mock := &Tracer{} 224 mock.Mock.Test(t) 225 226 t.Cleanup(func() { mock.AssertExpectations(t) }) 227 228 return mock 229 }