update comments
Alexander Babai
3 years ago
20 | 20 | // creation by our Endpoint middleware. |
21 | 21 | Tags opentracing.Tags |
22 | 22 | |
23 | // GetTags is an optional function that can extract trace tags | |
23 | // GetTags is an optional function that can extract tags | |
24 | 24 | // from the context and add them to the span. |
25 | 25 | GetTags func(ctx context.Context) opentracing.Tags |
26 | 26 | } |
27 | 27 | |
28 | // EndpointOption allows for functional options to Opentracing endpoint | |
29 | // tracing middleware. | |
28 | // EndpointOption allows for functional options to endpoint tracing middleware. | |
30 | 29 | type EndpointOption func(*EndpointOptions) |
31 | 30 | |
32 | // WithOptions sets all configuration options at once by use of the | |
33 | // EndpointOptions struct. | |
31 | // WithOptions sets all configuration options at once by use of the EndpointOptions struct. | |
34 | 32 | func WithOptions(options EndpointOptions) EndpointOption { |
35 | 33 | return func(o *EndpointOptions) { |
36 | 34 | *o = options |
60 | 58 | } |
61 | 59 | } |
62 | 60 | |
63 | // WithExtraTags extracts additional attributes from the context. | |
61 | // WithExtraTags extracts additional tags from the context. | |
64 | 62 | func WithExtraTags(getTags func(ctx context.Context) opentracing.Tags) EndpointOption { |
65 | 63 | return func(o *EndpointOptions) { |
66 | 64 | o.GetTags = getTags |