Skip to content
This repository has been archived by the owner on Mar 6, 2023. It is now read-only.

Commit

Permalink
Implement ForeachBaggageItem
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuri Shkuro committed Jul 1, 2016
1 parent bc2e227 commit b3f8a14
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
build/*
.idea/
10 changes: 10 additions & 0 deletions span.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,16 @@ func (s *spanImpl) BaggageItem(restrictedKey string) string {
return s.raw.Baggage[canonicalKey]
}

func (s *spanImpl) ForeachBaggageItem(handler func(k, v string) bool) {
s.Lock()
defer s.Unlock()
for k, v := range s.raw.Baggage {
if !handler(k, v) {
break
}
}
}

func (s *spanImpl) Tracer() opentracing.Tracer {
return s.tracer
}
Expand Down

0 comments on commit b3f8a14

Please sign in to comment.