spancontext.go 317 B

12345678910111213141516171819
  1. package trace
  2. type spanContext struct {
  3. traceId string
  4. spanId string
  5. }
  6. func (sc spanContext) TraceId() string {
  7. return sc.traceId
  8. }
  9. func (sc spanContext) SpanId() string {
  10. return sc.spanId
  11. }
  12. func (sc spanContext) Visit(fn func(key, val string) bool) {
  13. fn(traceIdKey, sc.traceId)
  14. fn(spanIdKey, sc.spanId)
  15. }