Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestInterface ¶
type TestInterface interface { F(ctx context.Context, a1 string, a2 ...string) (result1, result2 string, err error) NoErrorWithContext(context.Context, string) string NoError(string) string NoParamsOrResults() Channels(chA chan bool, chB chan<- bool, chanC <-chan bool) }
TestInterface is used to test templates
type TestInterfaceWithTracing ¶
type TestInterfaceWithTracing struct { TestInterface // contains filtered or unexported fields }
TestInterfaceWithTracing implements TestInterface interface instrumented with datadog spans
func NewTestInterfaceWithTracing ¶
func NewTestInterfaceWithTracing(base TestInterface, spanName string, spanDecorator func(span tracer.Span, params, results map[string]interface{}), errorMarkDecider ...func(err error) bool) TestInterfaceWithTracing
NewTestInterfaceWithTracing returns TestInterfaceWithTracing for the base service with a specified Datadog’s span name spanName (equals OpenTracing “component” tag), and allows to add extra data to the span by spanDecorator (a func to add some extra tags for a span). Pass nil if you don't need decorations. You can skip marking a span with an error mark by returning false in errorMarkDecider func. Optional, by default the decider always returns true.
Note: when using Datadog, the OpenTracing operation name is a resource and the OpenTracing “component” tag is Datadog’s span name. SpanName in DataDog becomes an "operation name" and "resource name" is taken from $method.Name Example. Create a span for a http request for url /user/profile: spanName = "http.request" resource = "/user/profile"
func (TestInterfaceWithTracing) F ¶
func (_d TestInterfaceWithTracing) F(ctx context.Context, a1 string, a2 ...string) (result1 string, result2 string, err error)
F implements TestInterface
func (TestInterfaceWithTracing) NoErrorWithContext ¶
func (_d TestInterfaceWithTracing) NoErrorWithContext(ctx context.Context, s1 string) (s2 string)
NoErrorWithContext implements TestInterface