tracecontext

package
v0.21.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2018 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package tracecontext provides encoders and decoders for Stackdriver Trace contexts.

Index

Constants

View Source
const (

	// Len represents the length of trace context.
	Len = 1 + 1 + traceIDLen + 1 + spanIDLen + 1 + optsLen
)

Variables

This section is empty.

Functions

func Decode

func Decode(src []byte) (traceID []byte, spanID uint64, opts byte, ok bool)

Decode decodes the src into a trace ID, span ID and options. If src doesn't contain a valid trace context, ok = false is returned.

func Encode

func Encode(dst []byte, traceID []byte, spanID uint64, opts byte) (n int)

Encode encodes trace ID, span ID and options into dst. The number of bytes written will be returned. If len(dst) isn't big enough to fit the trace context, a negative number is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL