зеркало из https://github.com/github/vitess-gh.git
Document an interface
Signed-off-by: Andres Taylor <antaylor@squareup.com>
This commit is contained in:
Родитель
2b52464112
Коммит
487135e5f8
|
@ -89,8 +89,13 @@ func CopySpan(parentCtx, spanCtx context.Context) context.Context {
|
|||
|
||||
// SpanFactory is an interface for creating spans or extracting them from Contexts.
|
||||
type SpanFactory interface {
|
||||
// New creates a new span from an existing one, if provided. The parent can also be nil
|
||||
New(parent Span, label string, spanType SpanType) Span
|
||||
|
||||
// Extracts a span from a context, making it possible to annotate the span with additional information.
|
||||
FromContext(ctx context.Context) (Span, bool)
|
||||
|
||||
// Creates a new context containing the provided span
|
||||
NewContext(parent context.Context, span Span) context.Context
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче