mirror of
https://gitee.com/johng/gf.git
synced 2024-12-02 04:07:47 +08:00
comment update for package gtrace
This commit is contained in:
parent
ad2b3e6cc6
commit
b2629b9bfa
@ -14,7 +14,7 @@ import (
|
||||
// Carrier is the storage medium used by a TextMapPropagator.
|
||||
type Carrier map[string]interface{}
|
||||
|
||||
// NewCarrier .
|
||||
// NewCarrier creates and returns a Carrier.
|
||||
func NewCarrier(data ...map[string]interface{}) Carrier {
|
||||
if len(data) > 0 && data[0] != nil {
|
||||
return data[0]
|
||||
@ -50,12 +50,12 @@ func (c Carrier) MustMarshal() []byte {
|
||||
return b
|
||||
}
|
||||
|
||||
// String .
|
||||
// String converts and returns current Carrier as string.
|
||||
func (c Carrier) String() string {
|
||||
return string(c.MustMarshal())
|
||||
}
|
||||
|
||||
// UnmarshalJSON .
|
||||
// UnmarshalJSON implements interface UnmarshalJSON for package json.
|
||||
func (c Carrier) UnmarshalJSON(b []byte) error {
|
||||
carrier := NewCarrier(nil)
|
||||
return json.UnmarshalUseNumber(b, carrier)
|
||||
|
@ -12,7 +12,7 @@ import (
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
)
|
||||
|
||||
// Span 。
|
||||
// Span warps trace.Span for compatibility and extension.
|
||||
type Span struct {
|
||||
trace.Span
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ import (
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
)
|
||||
|
||||
// Tracer .
|
||||
// Tracer warps trace.Tracer for compatibility and extension.
|
||||
type Tracer struct {
|
||||
trace.Tracer
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user