1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-01-03 22:52:30 +02:00

update type style (#28)

This commit is contained in:
thinkerou 2019-06-28 04:34:57 +08:00 committed by rghetia
parent 521a6c40f1
commit f5ec719fbd
3 changed files with 17 additions and 21 deletions

View File

@ -21,12 +21,10 @@ import (
apievent "github.com/open-telemetry/opentelemetry-go/api/event"
)
type (
event struct {
message string
attributes []core.KeyValue
}
)
type event struct {
message string
attributes []core.KeyValue
}
var _ apievent.Event = (*event)(nil)

View File

@ -26,6 +26,16 @@ import (
"github.com/open-telemetry/opentelemetry-go/exporter/observer"
)
type span struct {
tracer *tracer
spanContext core.SpanContext
lock sync.Mutex
eventID core.EventID
finishOnce sync.Once
recordEvent bool
status codes.Code
}
// SpancContext returns span context of the span. Return SpanContext is usable
// even after the span is finished.
func (sp *span) SpanContext() core.SpanContext {

View File

@ -29,21 +29,9 @@ import (
"github.com/open-telemetry/opentelemetry-go/sdk/event"
)
type (
span struct {
tracer *tracer
spanContext core.SpanContext
lock sync.Mutex
eventID core.EventID
finishOnce sync.Once
recordEvent bool
status codes.Code
}
tracer struct {
resources core.EventID
}
)
type tracer struct {
resources core.EventID
}
var (
ServiceKey = tag.New("service")