Documentation ¶
Index ¶
Constants ¶
const ( ValueTypeEmpty = internal.ValueTypeEmpty ValueTypeString = internal.ValueTypeString ValueTypeInt = internal.ValueTypeInt ValueTypeDouble = internal.ValueTypeDouble ValueTypeBool = internal.ValueTypeBool ValueTypeMap = internal.ValueTypeMap ValueTypeSlice = internal.ValueTypeSlice ValueTypeBytes = internal.ValueTypeBytes )
Variables ¶
var ( // NewValueEmpty creates a new Value with an empty value. NewValueEmpty = internal.NewValueEmpty // NewValueString creates a new Value with the given string value. NewValueString = internal.NewValueString // NewValueInt creates a new Value with the given int64 value. NewValueInt = internal.NewValueInt // NewValueDouble creates a new Value with the given float64 value. NewValueDouble = internal.NewValueDouble // NewValueBool creates a new Value with the given bool value. NewValueBool = internal.NewValueBool // NewValueMap creates a new Value of map type. NewValueMap = internal.NewValueMap // NewValueSlice creates a new Value of array type. NewValueSlice = internal.NewValueSlice // NewValueBytes creates a new Value with the given ImmutableByteSlice value. NewValueBytes = internal.NewValueBytes // NewValueMBytes creates a new Value with the given []byte value. // The caller must ensure the []byte passed in is not modified after the call is made, sharing the data // across multiple attributes is forbidden. // Deprecated: [0.54.0] Use NewValueBytes instead. NewValueMBytes = internal.NewValueMBytes )
var ( // NewMap creates a Map with 0 elements. NewMap = internal.NewMap // NewMapFromRaw creates a Map with values from the given map[string]interface{}. NewMapFromRaw = internal.NewMapFromRaw )
var InvalidSpanID = internal.InvalidSpanID
InvalidSpanID returns an empty (all zero bytes) SpanID.
var InvalidTraceID = internal.InvalidTraceID
InvalidTraceID returns an empty (all zero bytes) TraceID.
var NewImmutableByteSlice = internal.NewImmutableByteSlice
NewImmutableByteSlice creates a new ImmutableByteSlice by copying the provided []byte slice.
var NewImmutableFloat64Slice = internal.NewImmutableFloat64Slice
NewImmutableFloat64Slice creates a new ImmutableFloat64Slice by copying the provided []float64 slice.
var NewImmutableUInt64Slice = internal.NewImmutableUInt64Slice
NewImmutableUInt64Slice creates a new ImmutableUInt64Slice by copying the provided []uint64 slice.
var NewInstrumentationScope = internal.NewInstrumentationScope
NewInstrumentationScope is an alias for a function to create a new empty InstrumentationScope.
var NewResource = internal.NewResource
NewResource is an alias for a function to create a new empty Resource.
var NewSlice = internal.NewSlice
NewSlice creates a Slice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.
var NewSliceFromRaw = internal.NewSliceFromRaw
NewSliceFromRaw creates a Slice with values from the given []interface{}.
var NewSpanID = internal.NewSpanID
NewSpanID returns a new SpanID from the given byte array.
var NewTimestampFromTime = internal.NewTimestampFromTime
NewTimestampFromTime constructs a new Timestamp from the provided time.Time.
var NewTraceID = internal.NewTraceID
NewTraceID returns a new TraceID from the given byte array.
Functions ¶
This section is empty.
Types ¶
type ImmutableByteSlice ¶ added in v0.54.0
type ImmutableByteSlice = internal.ImmutableByteSlice
ImmutableByteSlice represents a []byte slice that cannot be mutated.
type ImmutableFloat64Slice ¶ added in v0.54.0
type ImmutableFloat64Slice = internal.ImmutableFloat64Slice
ImmutableFloat64Slice represents a []float64 slice that cannot be mutated.
type ImmutableUInt64Slice ¶ added in v0.54.0
type ImmutableUInt64Slice = internal.ImmutableUInt64Slice
ImmutableUInt64Slice represents a []uint64 slice that cannot be mutated.
type InstrumentationScope ¶
type InstrumentationScope = internal.InstrumentationScope
InstrumentationScope is a message representing the instrumentation scope information.
This is a reference type, if passed by value and callee modifies it the caller will see the modification.
Must use NewInstrumentationScope function to create new instances. Important: zero-initialized instance is not valid for use.
type Resource ¶
Resource is a message representing the resource information.
This is a reference type, if passed by value and callee modifies it the caller will see the modification.
Must use NewResource function to create new instances. Important: zero-initialized instance is not valid for use.
type Slice ¶
Slice logically represents a slice of Value.
This is a reference type. If passed by value and callee modifies it, the caller will see the modification.
Must use NewSlice function to create new instances. Important: zero-initialized instance is not valid for use.
type Timestamp ¶
Timestamp is a time specified as UNIX Epoch time in nanoseconds since 1970-01-01 00:00:00 +0000 UTC.
type Value ¶
Value is a mutable cell containing any value. Typically used as an element of Map or Slice. Must use one of NewValue+ functions below to create new instances.
Intended to be passed by value since internally it is just a pointer to actual value representation. For the same reason passing by value and calling setters will modify the original, e.g.:
func f1(val Value) { val.SetIntVal(234) } func f2() { v := NewValueString("a string") f1(v) _ := v.Type() // this will return ValueTypeInt }
Important: zero-initialized instance is not valid for use. All Value functions below must be called only on instances that are created via NewValue+ functions.