gocloud.google.com/go/internal/tracecontext Index | Files

package tracecontext

import "cloud.google.com/go/internal/tracecontext"

Package tracecontext provides encoders and decoders for Stackdriver Trace contexts.

Index

Constants

const (

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

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.

Source Files

tracecontext.go

Version
v0.26.0
Published
Aug 7, 2018
Platform
js/wasm
Imports
1 packages
Last checked
21 minutes ago

Tools for package owners.