-
Notifications
You must be signed in to change notification settings - Fork 178
/
tracer.go
171 lines (142 loc) · 4.62 KB
/
tracer.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
// Code generated by mockery v1.0.0. DO NOT EDIT.
package mock
import (
context "context"
flow "github.com/onflow/flow-go/model/flow"
mock "github.com/stretchr/testify/mock"
opentracing "github.com/opentracing/opentracing-go"
time "time"
trace "github.com/onflow/flow-go/module/trace"
)
// Tracer is an autogenerated mock type for the Tracer type
type Tracer struct {
mock.Mock
}
// Done provides a mock function with given fields:
func (_m *Tracer) Done() <-chan struct{} {
ret := _m.Called()
var r0 <-chan struct{}
if rf, ok := ret.Get(0).(func() <-chan struct{}); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(<-chan struct{})
}
}
return r0
}
// FinishSpan provides a mock function with given fields: entity, spanName
func (_m *Tracer) FinishSpan(entity flow.Identifier, spanName trace.SpanName) {
_m.Called(entity, spanName)
}
// GetSpan provides a mock function with given fields: entity, spanName
func (_m *Tracer) GetSpan(entity flow.Identifier, spanName trace.SpanName) (opentracing.Span, bool) {
ret := _m.Called(entity, spanName)
var r0 opentracing.Span
if rf, ok := ret.Get(0).(func(flow.Identifier, trace.SpanName) opentracing.Span); ok {
r0 = rf(entity, spanName)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(opentracing.Span)
}
}
var r1 bool
if rf, ok := ret.Get(1).(func(flow.Identifier, trace.SpanName) bool); ok {
r1 = rf(entity, spanName)
} else {
r1 = ret.Get(1).(bool)
}
return r0, r1
}
// Ready provides a mock function with given fields:
func (_m *Tracer) Ready() <-chan struct{} {
ret := _m.Called()
var r0 <-chan struct{}
if rf, ok := ret.Get(0).(func() <-chan struct{}); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(<-chan struct{})
}
}
return r0
}
// RecordSpanFromParent provides a mock function with given fields: span, operationName, duration, logs, opts
func (_m *Tracer) RecordSpanFromParent(span opentracing.Span, operationName trace.SpanName, duration time.Duration, logs []opentracing.LogRecord, opts ...opentracing.StartSpanOption) {
_va := make([]interface{}, len(opts))
for _i := range opts {
_va[_i] = opts[_i]
}
var _ca []interface{}
_ca = append(_ca, span, operationName, duration, logs)
_ca = append(_ca, _va...)
_m.Called(_ca...)
}
// StartSpan provides a mock function with given fields: entity, spanName, opts
func (_m *Tracer) StartSpan(entity flow.Identifier, spanName trace.SpanName, opts ...opentracing.StartSpanOption) opentracing.Span {
_va := make([]interface{}, len(opts))
for _i := range opts {
_va[_i] = opts[_i]
}
var _ca []interface{}
_ca = append(_ca, entity, spanName)
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
var r0 opentracing.Span
if rf, ok := ret.Get(0).(func(flow.Identifier, trace.SpanName, ...opentracing.StartSpanOption) opentracing.Span); ok {
r0 = rf(entity, spanName, opts...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(opentracing.Span)
}
}
return r0
}
// StartSpanFromContext provides a mock function with given fields: ctx, operationName, opts
func (_m *Tracer) StartSpanFromContext(ctx context.Context, operationName trace.SpanName, opts ...opentracing.StartSpanOption) (opentracing.Span, context.Context) {
_va := make([]interface{}, len(opts))
for _i := range opts {
_va[_i] = opts[_i]
}
var _ca []interface{}
_ca = append(_ca, ctx, operationName)
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
var r0 opentracing.Span
if rf, ok := ret.Get(0).(func(context.Context, trace.SpanName, ...opentracing.StartSpanOption) opentracing.Span); ok {
r0 = rf(ctx, operationName, opts...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(opentracing.Span)
}
}
var r1 context.Context
if rf, ok := ret.Get(1).(func(context.Context, trace.SpanName, ...opentracing.StartSpanOption) context.Context); ok {
r1 = rf(ctx, operationName, opts...)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(context.Context)
}
}
return r0, r1
}
// StartSpanFromParent provides a mock function with given fields: span, operationName, opts
func (_m *Tracer) StartSpanFromParent(span opentracing.Span, operationName trace.SpanName, opts ...opentracing.StartSpanOption) opentracing.Span {
_va := make([]interface{}, len(opts))
for _i := range opts {
_va[_i] = opts[_i]
}
var _ca []interface{}
_ca = append(_ca, span, operationName)
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
var r0 opentracing.Span
if rf, ok := ret.Get(0).(func(opentracing.Span, trace.SpanName, ...opentracing.StartSpanOption) opentracing.Span); ok {
r0 = rf(span, operationName, opts...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(opentracing.Span)
}
}
return r0
}