Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidListMember occurs if at least one list member is invalid, e.g., contains an unexpected character. ErrInvalidListMember = errors.New("tracecontext: Invalid tracestate list member") // ErrDuplicateListMemberKey occurs if at least two list members contain the same vendor-tenant pair. ErrDuplicateListMemberKey = errors.New("tracecontext: Duplicate list member key in tracestate") // ErrTooManyListMembers occurs if the list contains more than the maximum number of members per the spec, i.e., 32. ErrTooManyListMembers = errors.New("tracecontext: Too many list members in tracestate") )
Functions ¶
This section is empty.
Types ¶
type Member ¶
type Member struct { // Vendor is a key representing a particular trace vendor. Vendor string // Tenant is a key used to distinguish between tenants of a multi-tenant trace vendor. Tenant string // Value is the particular data that the vendor intents to pass to child spans. Value string }
Member contains vendor-specific data that should be propagated across all new spans started within a given trace.
type TraceState ¶
type TraceState []Member
TraceState represents a list of `Member`s that should be propagated to new spans started in a trace.
func Parse ¶
func Parse(traceState []byte) (TraceState, error)
Parse attempts to decode a `TraceState` from a byte array. It returns an error if the byte array is invalid, e.g., it contains an incorrectly formatted list member.
func ParseString ¶
func ParseString(traceState string) (TraceState, error)
ParseString attempts to decode a `TraceState` from a string. It returns an error if the string is invalid, e.g., it contains an incorrectly formatted list member.
func (TraceState) String ¶
func (ts TraceState) String() string
String encodes all `Member`s of the `TraceState` into a single string, formatted according to the W3C spec. The string may be invalid if any `Member`s are invalid, e.g., containing a non-compliant character.