Source File
propagation.go
Belonging Package
go.opencensus.io/trace/propagation
package propagation // import "go.opencensus.io/trace/propagation"
import (
)
func ( trace.SpanContext) []byte {
if == (trace.SpanContext{}) {
return nil
}
var [29]byte
copy([2:18], .TraceID[:])
[18] = 1
copy([19:27], .SpanID[:])
[27] = 2
[28] = uint8(.TraceOptions)
return [:]
}
func ( []byte) ( trace.SpanContext, bool) {
if len() == 0 || [0] != 0 {
return trace.SpanContext{}, false
}
= [1:]
if len() >= 17 && [0] == 0 {
copy(.TraceID[:], [1:17])
= [17:]
} else {
return trace.SpanContext{}, false
}
if len() >= 9 && [0] == 1 {
copy(.SpanID[:], [1:9])
= [9:]
}
if len() >= 2 && [0] == 2 {
.TraceOptions = trace.TraceOptions([1])
}
return , true
}
type HTTPFormat interface {
SpanContextFromRequest(req *http.Request) (sc trace.SpanContext, ok bool)
SpanContextToRequest(sc trace.SpanContext, req *http.Request)
}
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |