Permalink
Browse files

Replace the Referee terminology

  • Loading branch information...
1 parent b8a4c1a commit c57bf873ebee368a5b7a2425865047fa64107519 @bensigelman bensigelman committed Jul 25, 2016
Showing with 17 additions and 17 deletions.
  1. +4 −4 mocktracer/mockspan.go
  2. +1 −1 options_test.go
  3. +1 −1 testtracer_test.go
  4. +11 −11 tracer.go
@@ -113,10 +113,10 @@ func newMockSpan(t *MockTracer, name string, opts opentracing.StartSpanOptions)
var baggage map[string]string
sampled := true
if len(opts.References) > 0 {
- traceID = opts.References[0].Referee.(*MockSpanContext).TraceID
- parentID = opts.References[0].Referee.(*MockSpanContext).SpanID
- sampled = opts.References[0].Referee.(*MockSpanContext).Sampled
- baggage = opts.References[0].Referee.(*MockSpanContext).Baggage()
+ traceID = opts.References[0].ReferencedContext.(*MockSpanContext).TraceID
+ parentID = opts.References[0].ReferencedContext.(*MockSpanContext).SpanID
+ sampled = opts.References[0].ReferencedContext.(*MockSpanContext).Sampled
+ baggage = opts.References[0].ReferencedContext.(*MockSpanContext).Baggage()
}
spanContext := newMockSpanContext(traceID, nextMockID(), sampled, baggage)
startTime := opts.StartTime
View
@@ -25,7 +25,7 @@ func TestChildOfAndFollowsFrom(t *testing.T) {
ctx := new(noopSpanContext)
test.newOpt(ctx).Apply(opts)
require.Equal(t, []SpanReference{
- SpanReference{Referee: ctx, Type: test.refType},
+ SpanReference{ReferencedContext: ctx, Type: test.refType},
}, opts.References, "%s(ctx) must append a reference", test.name)
}
}
View
@@ -55,7 +55,7 @@ func (n testTracer) StartSpan(operationName string, opts ...StartSpanOption) Spa
func (n testTracer) startSpanWithOptions(name string, opts StartSpanOptions) Span {
fakeID := nextFakeID()
if len(opts.References) > 0 {
- fakeID = opts.References[0].Referee.(testSpanContext).FakeID
+ fakeID = opts.References[0].ReferencedContext.(testSpanContext).FakeID
}
return testSpan{
OperationName: name,
View
@@ -208,24 +208,24 @@ const (
)
// SpanReference is a StartSpanOption that pairs a SpanReferenceType and a
-// referee SpanContext ("referee" is "the one who is referred to"). See the
-// SpanReferenceType documentation for supported relationships.
-// If SpanReference is created with Referee == nil, it has no effect. Thus
-// it allows for a more concise syntax for starting spans:
+// referenced SpanContext. See the SpanReferenceType documentation for
+// supported relationships. If SpanReference is created with
+// ReferencedContext==nil, it has no effect. Thus it allows for a more concise
+// syntax for starting spans:
//
// sc, _ := tracer.Extract(someFormat, someCarrier)
// span := tracer.StartSpan("operation", opentracing.ChildOf(sc))
//
// The `ChildOf(sc)` option above will not panic if sc == nil, it will just
// not add the parent span reference to the options.
type SpanReference struct {
- Type SpanReferenceType
- Referee SpanContext
+ Type SpanReferenceType
+ ReferencedContext SpanContext
}
// Apply satisfies the StartSpanOption interface.
func (r SpanReference) Apply(o *StartSpanOptions) {
- if r.Referee != nil {
+ if r.ReferencedContext != nil {
o.References = append(o.References, r)
}
}
@@ -236,8 +236,8 @@ func (r SpanReference) Apply(o *StartSpanOptions) {
// See ChildOfRef, SpanReference
func ChildOf(sc SpanContext) SpanReference {
return SpanReference{
- Type: ChildOfRef,
- Referee: sc,
+ Type: ChildOfRef,
+ ReferencedContext: sc,
}
}
@@ -248,8 +248,8 @@ func ChildOf(sc SpanContext) SpanReference {
// See FollowsFromRef, SpanReference
func FollowsFrom(sc SpanContext) SpanReference {
return SpanReference{
- Type: FollowsFromRef,
- Referee: sc,
+ Type: FollowsFromRef,
+ ReferencedContext: sc,
}
}

0 comments on commit c57bf87

Please sign in to comment.