func WithParent(parent Span) SpanOption {
	var parentCtx SpanContext
	if parent != nil {
		parentCtx = parent.Context()
	}
	return WithParentSpanContext(parentCtx)
}
WithParent sets the parent SpanContext to be the context of the specified span. If the provided span is nil, the
parent span context is explicitly set to be nil (indicating that the created span is a root span).
package wtracing
import (
	"time"
)
type TraceID string
type SpanID string
type Span interface {
	Context() SpanContext
	Tag(key string, value string)
	Finish()
}
type SpanModel struct {
	SpanContext
	Name           string
	Kind           Kind
	Timestamp      time.Time
	Duration       time.Duration
	LocalEndpoint  *Endpoint
	RemoteEndpoint *Endpoint
	Tags           map[string]string
}
type SpanContext struct {
	TraceID  TraceID
	ID       SpanID
	ParentID *SpanID
	Debug    bool
	Sampled  *bool
	Err      error
}
func FromSpanOptions(opts ...SpanOption) *SpanOptionImpl {
	impl := &SpanOptionImpl{}
	for _, opt := range opts {
		if opt == nil {
			continue
		}
		opt.apply(impl)
	}
	return impl
}
type SpanOption interface {
	apply(impl *SpanOptionImpl)
}
type spanOptionFn func(impl *SpanOptionImpl)
func (t spanOptionFn) apply(impl *SpanOptionImpl) {
	t(impl)
}
type SpanOptionImpl struct {
	RemoteEndpoint *Endpoint
	ParentSpan     *SpanContext
	Kind           Kind
	Tags           map[string]string
}
func WithKind(kind Kind) SpanOption {
	return spanOptionFn(func(impl *SpanOptionImpl) {
		impl.Kind = kind
	})
}