github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/module/mock/tracer.go (about)

     1  // Code generated by mockery v2.21.4. DO NOT EDIT.
     2  
     3  package mock
     4  
     5  import (
     6  	context "context"
     7  
     8  	flow "github.com/onflow/flow-go/model/flow"
     9  	mock "github.com/stretchr/testify/mock"
    10  
    11  	moduletrace "github.com/onflow/flow-go/module/trace"
    12  
    13  	trace "go.opentelemetry.io/otel/trace"
    14  )
    15  
    16  // Tracer is an autogenerated mock type for the Tracer type
    17  type Tracer struct {
    18  	mock.Mock
    19  }
    20  
    21  // BlockRootSpan provides a mock function with given fields: blockID
    22  func (_m *Tracer) BlockRootSpan(blockID flow.Identifier) trace.Span {
    23  	ret := _m.Called(blockID)
    24  
    25  	var r0 trace.Span
    26  	if rf, ok := ret.Get(0).(func(flow.Identifier) trace.Span); ok {
    27  		r0 = rf(blockID)
    28  	} else {
    29  		if ret.Get(0) != nil {
    30  			r0 = ret.Get(0).(trace.Span)
    31  		}
    32  	}
    33  
    34  	return r0
    35  }
    36  
    37  // Done provides a mock function with given fields:
    38  func (_m *Tracer) Done() <-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  // Ready provides a mock function with given fields:
    54  func (_m *Tracer) Ready() <-chan struct{} {
    55  	ret := _m.Called()
    56  
    57  	var r0 <-chan struct{}
    58  	if rf, ok := ret.Get(0).(func() <-chan struct{}); ok {
    59  		r0 = rf()
    60  	} else {
    61  		if ret.Get(0) != nil {
    62  			r0 = ret.Get(0).(<-chan struct{})
    63  		}
    64  	}
    65  
    66  	return r0
    67  }
    68  
    69  // ShouldSample provides a mock function with given fields: entityID
    70  func (_m *Tracer) ShouldSample(entityID flow.Identifier) bool {
    71  	ret := _m.Called(entityID)
    72  
    73  	var r0 bool
    74  	if rf, ok := ret.Get(0).(func(flow.Identifier) bool); ok {
    75  		r0 = rf(entityID)
    76  	} else {
    77  		r0 = ret.Get(0).(bool)
    78  	}
    79  
    80  	return r0
    81  }
    82  
    83  // StartBlockSpan provides a mock function with given fields: ctx, blockID, spanName, opts
    84  func (_m *Tracer) StartBlockSpan(ctx context.Context, blockID flow.Identifier, spanName moduletrace.SpanName, opts ...trace.SpanStartOption) (trace.Span, context.Context) {
    85  	_va := make([]interface{}, len(opts))
    86  	for _i := range opts {
    87  		_va[_i] = opts[_i]
    88  	}
    89  	var _ca []interface{}
    90  	_ca = append(_ca, ctx, blockID, spanName)
    91  	_ca = append(_ca, _va...)
    92  	ret := _m.Called(_ca...)
    93  
    94  	var r0 trace.Span
    95  	var r1 context.Context
    96  	if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier, moduletrace.SpanName, ...trace.SpanStartOption) (trace.Span, context.Context)); ok {
    97  		return rf(ctx, blockID, spanName, opts...)
    98  	}
    99  	if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier, moduletrace.SpanName, ...trace.SpanStartOption) trace.Span); ok {
   100  		r0 = rf(ctx, blockID, spanName, opts...)
   101  	} else {
   102  		if ret.Get(0) != nil {
   103  			r0 = ret.Get(0).(trace.Span)
   104  		}
   105  	}
   106  
   107  	if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier, moduletrace.SpanName, ...trace.SpanStartOption) context.Context); ok {
   108  		r1 = rf(ctx, blockID, spanName, opts...)
   109  	} else {
   110  		if ret.Get(1) != nil {
   111  			r1 = ret.Get(1).(context.Context)
   112  		}
   113  	}
   114  
   115  	return r0, r1
   116  }
   117  
   118  // StartCollectionSpan provides a mock function with given fields: ctx, collectionID, spanName, opts
   119  func (_m *Tracer) StartCollectionSpan(ctx context.Context, collectionID flow.Identifier, spanName moduletrace.SpanName, opts ...trace.SpanStartOption) (trace.Span, context.Context) {
   120  	_va := make([]interface{}, len(opts))
   121  	for _i := range opts {
   122  		_va[_i] = opts[_i]
   123  	}
   124  	var _ca []interface{}
   125  	_ca = append(_ca, ctx, collectionID, spanName)
   126  	_ca = append(_ca, _va...)
   127  	ret := _m.Called(_ca...)
   128  
   129  	var r0 trace.Span
   130  	var r1 context.Context
   131  	if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier, moduletrace.SpanName, ...trace.SpanStartOption) (trace.Span, context.Context)); ok {
   132  		return rf(ctx, collectionID, spanName, opts...)
   133  	}
   134  	if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier, moduletrace.SpanName, ...trace.SpanStartOption) trace.Span); ok {
   135  		r0 = rf(ctx, collectionID, spanName, opts...)
   136  	} else {
   137  		if ret.Get(0) != nil {
   138  			r0 = ret.Get(0).(trace.Span)
   139  		}
   140  	}
   141  
   142  	if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier, moduletrace.SpanName, ...trace.SpanStartOption) context.Context); ok {
   143  		r1 = rf(ctx, collectionID, spanName, opts...)
   144  	} else {
   145  		if ret.Get(1) != nil {
   146  			r1 = ret.Get(1).(context.Context)
   147  		}
   148  	}
   149  
   150  	return r0, r1
   151  }
   152  
   153  // StartSampledSpanFromParent provides a mock function with given fields: parentSpan, entityID, operationName, opts
   154  func (_m *Tracer) StartSampledSpanFromParent(parentSpan trace.Span, entityID flow.Identifier, operationName moduletrace.SpanName, opts ...trace.SpanStartOption) trace.Span {
   155  	_va := make([]interface{}, len(opts))
   156  	for _i := range opts {
   157  		_va[_i] = opts[_i]
   158  	}
   159  	var _ca []interface{}
   160  	_ca = append(_ca, parentSpan, entityID, operationName)
   161  	_ca = append(_ca, _va...)
   162  	ret := _m.Called(_ca...)
   163  
   164  	var r0 trace.Span
   165  	if rf, ok := ret.Get(0).(func(trace.Span, flow.Identifier, moduletrace.SpanName, ...trace.SpanStartOption) trace.Span); ok {
   166  		r0 = rf(parentSpan, entityID, operationName, opts...)
   167  	} else {
   168  		if ret.Get(0) != nil {
   169  			r0 = ret.Get(0).(trace.Span)
   170  		}
   171  	}
   172  
   173  	return r0
   174  }
   175  
   176  // StartSpanFromContext provides a mock function with given fields: ctx, operationName, opts
   177  func (_m *Tracer) StartSpanFromContext(ctx context.Context, operationName moduletrace.SpanName, opts ...trace.SpanStartOption) (trace.Span, context.Context) {
   178  	_va := make([]interface{}, len(opts))
   179  	for _i := range opts {
   180  		_va[_i] = opts[_i]
   181  	}
   182  	var _ca []interface{}
   183  	_ca = append(_ca, ctx, operationName)
   184  	_ca = append(_ca, _va...)
   185  	ret := _m.Called(_ca...)
   186  
   187  	var r0 trace.Span
   188  	var r1 context.Context
   189  	if rf, ok := ret.Get(0).(func(context.Context, moduletrace.SpanName, ...trace.SpanStartOption) (trace.Span, context.Context)); ok {
   190  		return rf(ctx, operationName, opts...)
   191  	}
   192  	if rf, ok := ret.Get(0).(func(context.Context, moduletrace.SpanName, ...trace.SpanStartOption) trace.Span); ok {
   193  		r0 = rf(ctx, operationName, opts...)
   194  	} else {
   195  		if ret.Get(0) != nil {
   196  			r0 = ret.Get(0).(trace.Span)
   197  		}
   198  	}
   199  
   200  	if rf, ok := ret.Get(1).(func(context.Context, moduletrace.SpanName, ...trace.SpanStartOption) context.Context); ok {
   201  		r1 = rf(ctx, operationName, opts...)
   202  	} else {
   203  		if ret.Get(1) != nil {
   204  			r1 = ret.Get(1).(context.Context)
   205  		}
   206  	}
   207  
   208  	return r0, r1
   209  }
   210  
   211  // StartSpanFromParent provides a mock function with given fields: parentSpan, operationName, opts
   212  func (_m *Tracer) StartSpanFromParent(parentSpan trace.Span, operationName moduletrace.SpanName, opts ...trace.SpanStartOption) trace.Span {
   213  	_va := make([]interface{}, len(opts))
   214  	for _i := range opts {
   215  		_va[_i] = opts[_i]
   216  	}
   217  	var _ca []interface{}
   218  	_ca = append(_ca, parentSpan, operationName)
   219  	_ca = append(_ca, _va...)
   220  	ret := _m.Called(_ca...)
   221  
   222  	var r0 trace.Span
   223  	if rf, ok := ret.Get(0).(func(trace.Span, moduletrace.SpanName, ...trace.SpanStartOption) trace.Span); ok {
   224  		r0 = rf(parentSpan, operationName, opts...)
   225  	} else {
   226  		if ret.Get(0) != nil {
   227  			r0 = ret.Get(0).(trace.Span)
   228  		}
   229  	}
   230  
   231  	return r0
   232  }
   233  
   234  // WithSpanFromContext provides a mock function with given fields: ctx, operationName, f, opts
   235  func (_m *Tracer) WithSpanFromContext(ctx context.Context, operationName moduletrace.SpanName, f func(), opts ...trace.SpanStartOption) {
   236  	_va := make([]interface{}, len(opts))
   237  	for _i := range opts {
   238  		_va[_i] = opts[_i]
   239  	}
   240  	var _ca []interface{}
   241  	_ca = append(_ca, ctx, operationName, f)
   242  	_ca = append(_ca, _va...)
   243  	_m.Called(_ca...)
   244  }
   245  
   246  type mockConstructorTestingTNewTracer interface {
   247  	mock.TestingT
   248  	Cleanup(func())
   249  }
   250  
   251  // 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.
   252  func NewTracer(t mockConstructorTestingTNewTracer) *Tracer {
   253  	mock := &Tracer{}
   254  	mock.Mock.Test(t)
   255  
   256  	t.Cleanup(func() { mock.AssertExpectations(t) })
   257  
   258  	return mock
   259  }