Documentation
¶
Index ¶
- type ByteSlice
- func (ms ByteSlice) All() iter.Seq2[int, byte]
- func (ms ByteSlice) Append(elms ...byte)
- func (ms ByteSlice) AsRaw() []byte
- func (ms ByteSlice) At(i int) byte
- func (ms ByteSlice) CopyTo(dest ByteSlice)
- func (ms ByteSlice) EnsureCapacity(newCap int)
- func (ms ByteSlice) Equal(val ByteSlice) bool
- func (ms ByteSlice) FromRaw(val []byte)
- func (ms ByteSlice) Len() int
- func (ms ByteSlice) MoveAndAppendTo(dest ByteSlice)
- func (ms ByteSlice) MoveTo(dest ByteSlice)
- func (ms ByteSlice) SetAt(i int, val byte)
- type Float64Slice
- func (ms Float64Slice) All() iter.Seq2[int, float64]
- func (ms Float64Slice) Append(elms ...float64)
- func (ms Float64Slice) AsRaw() []float64
- func (ms Float64Slice) At(i int) float64
- func (ms Float64Slice) CopyTo(dest Float64Slice)
- func (ms Float64Slice) EnsureCapacity(newCap int)
- func (ms Float64Slice) Equal(val Float64Slice) bool
- func (ms Float64Slice) FromRaw(val []float64)
- func (ms Float64Slice) Len() int
- func (ms Float64Slice) MoveAndAppendTo(dest Float64Slice)
- func (ms Float64Slice) MoveTo(dest Float64Slice)
- func (ms Float64Slice) SetAt(i int, val float64)
- type InstrumentationScope
- func (ms InstrumentationScope) Attributes() Map
- func (ms InstrumentationScope) CopyTo(dest InstrumentationScope)
- func (ms InstrumentationScope) DroppedAttributesCount() uint32
- func (ms InstrumentationScope) MoveTo(dest InstrumentationScope)
- func (ms InstrumentationScope) Name() string
- func (ms InstrumentationScope) SetDroppedAttributesCount(v uint32)
- func (ms InstrumentationScope) SetName(v string)
- func (ms InstrumentationScope) SetVersion(v string)
- func (ms InstrumentationScope) Version() string
- type Int32Slice
- func (ms Int32Slice) All() iter.Seq2[int, int32]
- func (ms Int32Slice) Append(elms ...int32)
- func (ms Int32Slice) AsRaw() []int32
- func (ms Int32Slice) At(i int) int32
- func (ms Int32Slice) CopyTo(dest Int32Slice)
- func (ms Int32Slice) EnsureCapacity(newCap int)
- func (ms Int32Slice) Equal(val Int32Slice) bool
- func (ms Int32Slice) FromRaw(val []int32)
- func (ms Int32Slice) Len() int
- func (ms Int32Slice) MoveAndAppendTo(dest Int32Slice)
- func (ms Int32Slice) MoveTo(dest Int32Slice)
- func (ms Int32Slice) SetAt(i int, val int32)
- type Int64Slice
- func (ms Int64Slice) All() iter.Seq2[int, int64]
- func (ms Int64Slice) Append(elms ...int64)
- func (ms Int64Slice) AsRaw() []int64
- func (ms Int64Slice) At(i int) int64
- func (ms Int64Slice) CopyTo(dest Int64Slice)
- func (ms Int64Slice) EnsureCapacity(newCap int)
- func (ms Int64Slice) Equal(val Int64Slice) bool
- func (ms Int64Slice) FromRaw(val []int64)
- func (ms Int64Slice) Len() int
- func (ms Int64Slice) MoveAndAppendTo(dest Int64Slice)
- func (ms Int64Slice) MoveTo(dest Int64Slice)
- func (ms Int64Slice) SetAt(i int, val int64)
- type IntSlice
- func (ms IntSlice) Append(elms ...int)
- func (ms IntSlice) AsRaw() []int
- func (ms IntSlice) At(i int) int
- func (ms IntSlice) CopyTo(dest IntSlice)
- func (ms IntSlice) EnsureCapacity(newCap int)
- func (ms IntSlice) FromRaw(val []int)
- func (ms IntSlice) Len() int
- func (ms IntSlice) MoveTo(dest IntSlice)
- func (ms IntSlice) SetAt(i int, val int)
- type Map
- func (m Map) All() iter.Seq2[string, Value]
- func (m Map) AsRaw() map[string]any
- func (m Map) Clear()
- func (m Map) CopyTo(dest Map)
- func (m Map) EnsureCapacity(capacity int)
- func (m Map) Equal(val Map) bool
- func (m Map) FromRaw(rawMap map[string]any) error
- func (m Map) Get(key string) (Value, bool)
- func (m Map) Len() int
- func (m Map) MoveTo(dest Map)
- func (m Map) PutBool(k string, v bool)
- func (m Map) PutDouble(k string, v float64)
- func (m Map) PutEmpty(k string) Value
- func (m Map) PutEmptyBytes(k string) ByteSlice
- func (m Map) PutEmptyMap(k string) Map
- func (m Map) PutEmptySlice(k string) Slice
- func (m Map) PutInt(k string, v int64)
- func (m Map) PutStr(k string, v string)
- func (m Map) Range(f func(k string, v Value) bool)
- func (m Map) Remove(key string) bool
- func (m Map) RemoveIf(f func(string, Value) bool)
- type Resource
- type Slice
- func (es Slice) All() iter.Seq2[int, Value]
- func (es Slice) AppendEmpty() Value
- func (es Slice) AsRaw() []any
- func (es Slice) At(ix int) Value
- func (es Slice) CopyTo(dest Slice)
- func (es Slice) EnsureCapacity(newCap int)
- func (es Slice) Equal(val Slice) bool
- func (es Slice) FromRaw(rawSlice []any) error
- func (es Slice) Len() int
- func (es Slice) MoveAndAppendTo(dest Slice)
- func (es Slice) RemoveIf(f func(Value) bool)
- type SpanID
- type StringSlice
- func (ms StringSlice) All() iter.Seq2[int, string]
- func (ms StringSlice) Append(elms ...string)
- func (ms StringSlice) AsRaw() []string
- func (ms StringSlice) At(i int) string
- func (ms StringSlice) CopyTo(dest StringSlice)
- func (ms StringSlice) EnsureCapacity(newCap int)
- func (ms StringSlice) Equal(val StringSlice) bool
- func (ms StringSlice) FromRaw(val []string)
- func (ms StringSlice) Len() int
- func (ms StringSlice) MoveAndAppendTo(dest StringSlice)
- func (ms StringSlice) MoveTo(dest StringSlice)
- func (ms StringSlice) SetAt(i int, val string)
- type Timestamp
- type TraceID
- type TraceState
- type UInt64Slice
- func (ms UInt64Slice) All() iter.Seq2[int, uint64]
- func (ms UInt64Slice) Append(elms ...uint64)
- func (ms UInt64Slice) AsRaw() []uint64
- func (ms UInt64Slice) At(i int) uint64
- func (ms UInt64Slice) CopyTo(dest UInt64Slice)
- func (ms UInt64Slice) EnsureCapacity(newCap int)
- func (ms UInt64Slice) Equal(val UInt64Slice) bool
- func (ms UInt64Slice) FromRaw(val []uint64)
- func (ms UInt64Slice) Len() int
- func (ms UInt64Slice) MoveAndAppendTo(dest UInt64Slice)
- func (ms UInt64Slice) MoveTo(dest UInt64Slice)
- func (ms UInt64Slice) SetAt(i int, val uint64)
- type Value
- func (v Value) AsRaw() any
- func (v Value) AsString() string
- func (v Value) Bool() bool
- func (v Value) Bytes() ByteSlice
- func (v Value) CopyTo(dest Value)
- func (v Value) Double() float64
- func (v Value) Equal(c Value) bool
- func (v Value) FromRaw(iv any) error
- func (v Value) Int() int64
- func (v Value) Map() Map
- func (v Value) MoveTo(dest Value)
- func (v Value) SetBool(bv bool)
- func (v Value) SetDouble(dv float64)
- func (v Value) SetEmptyBytes() ByteSlice
- func (v Value) SetEmptyMap() Map
- func (v Value) SetEmptySlice() Slice
- func (v Value) SetInt(iv int64)
- func (v Value) SetStr(sv string)
- func (v Value) Slice() Slice
- func (v Value) Str() string
- func (v Value) Type() ValueType
- type ValueType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ByteSlice ¶
ByteSlice represents a []byte slice. The instance of ByteSlice can be assigned to multiple objects since it's immutable.
Must use NewByteSlice function to create new instances. Important: zero-initialized instance is not valid for use.
func (ByteSlice) Append ¶
Append appends extra elements to ByteSlice. Equivalent of byteSlice = append(byteSlice, elms...)
func (ByteSlice) CopyTo ¶
CopyTo copies all elements from the current slice overriding the destination.
func (ByteSlice) EnsureCapacity ¶
EnsureCapacity ensures ByteSlice has at least the specified capacity.
- If the newCap <= cap, then is no change in capacity.
- If the newCap > cap, then the slice capacity will be expanded to the provided value which will be equivalent of: buf := make([]byte, len(byteSlice), newCap) copy(buf, byteSlice) byteSlice = buf
func (ByteSlice) MoveAndAppendTo ¶
MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.
type Float64Slice ¶
type Float64Slice internal.Float64Slice
Float64Slice represents a []float64 slice. The instance of Float64Slice can be assigned to multiple objects since it's immutable.
Must use NewFloat64Slice function to create new instances. Important: zero-initialized instance is not valid for use.
func NewFloat64Slice ¶
func NewFloat64Slice() Float64Slice
NewFloat64Slice creates a new empty Float64Slice.
func (Float64Slice) All ¶
func (ms Float64Slice) All() iter.Seq2[int, float64]
All returns an iterator over index-value pairs in the slice.
func (Float64Slice) Append ¶
func (ms Float64Slice) Append(elms ...float64)
Append appends extra elements to Float64Slice. Equivalent of float64Slice = append(float64Slice, elms...)
func (Float64Slice) AsRaw ¶
func (ms Float64Slice) AsRaw() []float64
AsRaw returns a copy of the []float64 slice.
func (Float64Slice) At ¶
func (ms Float64Slice) At(i int) float64
At returns an item from particular index. Equivalent of float64Slice[i].
func (Float64Slice) CopyTo ¶
func (ms Float64Slice) CopyTo(dest Float64Slice)
CopyTo copies all elements from the current slice overriding the destination.
func (Float64Slice) EnsureCapacity ¶
func (ms Float64Slice) EnsureCapacity(newCap int)
EnsureCapacity ensures Float64Slice has at least the specified capacity.
- If the newCap <= cap, then is no change in capacity.
- If the newCap > cap, then the slice capacity will be expanded to the provided value which will be equivalent of: buf := make([]float64, len(float64Slice), newCap) copy(buf, float64Slice) float64Slice = buf
func (Float64Slice) Equal ¶
func (ms Float64Slice) Equal(val Float64Slice) bool
Equal checks equality with another Float64Slice
func (Float64Slice) FromRaw ¶
func (ms Float64Slice) FromRaw(val []float64)
FromRaw copies raw []float64 into the slice Float64Slice.
func (Float64Slice) Len ¶
func (ms Float64Slice) Len() int
Len returns length of the []float64 slice value. Equivalent of len(float64Slice).
func (Float64Slice) MoveAndAppendTo ¶
func (ms Float64Slice) MoveAndAppendTo(dest Float64Slice)
MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.
func (Float64Slice) MoveTo ¶
func (ms Float64Slice) MoveTo(dest Float64Slice)
MoveTo moves all elements from the current slice overriding the destination and resetting the current instance to its zero value.
func (Float64Slice) SetAt ¶
func (ms Float64Slice) SetAt(i int, val float64)
SetAt sets float64 item at particular index. Equivalent of float64Slice[i] = val
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.
func NewInstrumentationScope ¶
func NewInstrumentationScope() InstrumentationScope
NewInstrumentationScope creates a new empty InstrumentationScope.
This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.
func (InstrumentationScope) Attributes ¶
func (ms InstrumentationScope) Attributes() Map
Attributes returns the Attributes associated with this InstrumentationScope.
func (InstrumentationScope) CopyTo ¶
func (ms InstrumentationScope) CopyTo(dest InstrumentationScope)
CopyTo copies all properties from the current struct overriding the destination.
func (InstrumentationScope) DroppedAttributesCount ¶
func (ms InstrumentationScope) DroppedAttributesCount() uint32
DroppedAttributesCount returns the droppedattributescount associated with this InstrumentationScope.
func (InstrumentationScope) MoveTo ¶
func (ms InstrumentationScope) MoveTo(dest InstrumentationScope)
MoveTo moves all properties from the current struct overriding the destination and resetting the current instance to its zero value
func (InstrumentationScope) Name ¶
func (ms InstrumentationScope) Name() string
Name returns the name associated with this InstrumentationScope.
func (InstrumentationScope) SetDroppedAttributesCount ¶
func (ms InstrumentationScope) SetDroppedAttributesCount(v uint32)
SetDroppedAttributesCount replaces the droppedattributescount associated with this InstrumentationScope.
func (InstrumentationScope) SetName ¶
func (ms InstrumentationScope) SetName(v string)
SetName replaces the name associated with this InstrumentationScope.
func (InstrumentationScope) SetVersion ¶
func (ms InstrumentationScope) SetVersion(v string)
SetVersion replaces the version associated with this InstrumentationScope.
func (InstrumentationScope) Version ¶
func (ms InstrumentationScope) Version() string
Version returns the version associated with this InstrumentationScope.
type Int32Slice ¶
type Int32Slice internal.Int32Slice
Int32Slice represents a []int32 slice. The instance of Int32Slice can be assigned to multiple objects since it's immutable.
Must use NewInt32Slice function to create new instances. Important: zero-initialized instance is not valid for use.
func (Int32Slice) All ¶
func (ms Int32Slice) All() iter.Seq2[int, int32]
All returns an iterator over index-value pairs in the slice.
func (Int32Slice) Append ¶
func (ms Int32Slice) Append(elms ...int32)
Append appends extra elements to Int32Slice. Equivalent of int32Slice = append(int32Slice, elms...)
func (Int32Slice) AsRaw ¶
func (ms Int32Slice) AsRaw() []int32
AsRaw returns a copy of the []int32 slice.
func (Int32Slice) At ¶
func (ms Int32Slice) At(i int) int32
At returns an item from particular index. Equivalent of int32Slice[i].
func (Int32Slice) CopyTo ¶
func (ms Int32Slice) CopyTo(dest Int32Slice)
CopyTo copies all elements from the current slice overriding the destination.
func (Int32Slice) EnsureCapacity ¶
func (ms Int32Slice) EnsureCapacity(newCap int)
EnsureCapacity ensures Int32Slice has at least the specified capacity.
- If the newCap <= cap, then is no change in capacity.
- If the newCap > cap, then the slice capacity will be expanded to the provided value which will be equivalent of: buf := make([]int32, len(int32Slice), newCap) copy(buf, int32Slice) int32Slice = buf
func (Int32Slice) Equal ¶
func (ms Int32Slice) Equal(val Int32Slice) bool
Equal checks equality with another Int32Slice
func (Int32Slice) FromRaw ¶
func (ms Int32Slice) FromRaw(val []int32)
FromRaw copies raw []int32 into the slice Int32Slice.
func (Int32Slice) Len ¶
func (ms Int32Slice) Len() int
Len returns length of the []int32 slice value. Equivalent of len(int32Slice).
func (Int32Slice) MoveAndAppendTo ¶
func (ms Int32Slice) MoveAndAppendTo(dest Int32Slice)
MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.
func (Int32Slice) MoveTo ¶
func (ms Int32Slice) MoveTo(dest Int32Slice)
MoveTo moves all elements from the current slice overriding the destination and resetting the current instance to its zero value.
func (Int32Slice) SetAt ¶
func (ms Int32Slice) SetAt(i int, val int32)
SetAt sets int32 item at particular index. Equivalent of int32Slice[i] = val
type Int64Slice ¶
type Int64Slice internal.Int64Slice
Int64Slice represents a []int64 slice. The instance of Int64Slice can be assigned to multiple objects since it's immutable.
Must use NewInt64Slice function to create new instances. Important: zero-initialized instance is not valid for use.
func (Int64Slice) All ¶
func (ms Int64Slice) All() iter.Seq2[int, int64]
All returns an iterator over index-value pairs in the slice.
func (Int64Slice) Append ¶
func (ms Int64Slice) Append(elms ...int64)
Append appends extra elements to Int64Slice. Equivalent of int64Slice = append(int64Slice, elms...)
func (Int64Slice) AsRaw ¶
func (ms Int64Slice) AsRaw() []int64
AsRaw returns a copy of the []int64 slice.
func (Int64Slice) At ¶
func (ms Int64Slice) At(i int) int64
At returns an item from particular index. Equivalent of int64Slice[i].
func (Int64Slice) CopyTo ¶
func (ms Int64Slice) CopyTo(dest Int64Slice)
CopyTo copies all elements from the current slice overriding the destination.
func (Int64Slice) EnsureCapacity ¶
func (ms Int64Slice) EnsureCapacity(newCap int)
EnsureCapacity ensures Int64Slice has at least the specified capacity.
- If the newCap <= cap, then is no change in capacity.
- If the newCap > cap, then the slice capacity will be expanded to the provided value which will be equivalent of: buf := make([]int64, len(int64Slice), newCap) copy(buf, int64Slice) int64Slice = buf
func (Int64Slice) Equal ¶
func (ms Int64Slice) Equal(val Int64Slice) bool
Equal checks equality with another Int64Slice
func (Int64Slice) FromRaw ¶
func (ms Int64Slice) FromRaw(val []int64)
FromRaw copies raw []int64 into the slice Int64Slice.
func (Int64Slice) Len ¶
func (ms Int64Slice) Len() int
Len returns length of the []int64 slice value. Equivalent of len(int64Slice).
func (Int64Slice) MoveAndAppendTo ¶
func (ms Int64Slice) MoveAndAppendTo(dest Int64Slice)
MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.
func (Int64Slice) MoveTo ¶
func (ms Int64Slice) MoveTo(dest Int64Slice)
MoveTo moves all elements from the current slice overriding the destination and resetting the current instance to its zero value.
func (Int64Slice) SetAt ¶
func (ms Int64Slice) SetAt(i int, val int64)
SetAt sets int64 item at particular index. Equivalent of int64Slice[i] = val
type IntSlice ¶
IntSlice represents a []int slice. The instance of IntSlice can be assigned to multiple objects since it's immutable.
Must use NewIntSlice function to create new instances. Important: zero-initialized instance is not valid for use.
func (IntSlice) Append ¶
Append appends extra elements to IntSlice. Equivalent of intSlice = append(intSlice, elms...)
func (IntSlice) CopyTo ¶
CopyTo copies all elements from the current slice overriding the destination.
func (IntSlice) EnsureCapacity ¶
EnsureCapacity ensures IntSlice has at least the specified capacity.
- If the newCap <= cap, then is no change in capacity.
- If the newCap > cap, then the slice capacity will be expanded to the provided value which will be equivalent of: buf := make([]int, len(intSlice), newCap) copy(buf, intSlice) intSlice = buf
type Map ¶
Map stores a map of string keys to elements of Value type.
Must use NewMap function to create new instances. Important: zero-initialized instance is not valid for use.
func (Map) All ¶
All returns an iterator over key-value pairs in the Map.
for k, v := range es.All() {
... // Do something with key-value pair
}
func (Map) EnsureCapacity ¶
EnsureCapacity increases the capacity of this Map instance, if necessary, to ensure that it can hold at least the number of elements specified by the capacity argument.
func (Map) Get ¶
Get returns the Value associated with the key and true. Returned Value is not a copy, it is a reference to the value stored in this map. It is allowed to modify the returned value using Value.Set* functions. Such modification will be applied to the value stored in this map.
If the key does not exist returns a zero-initialized KeyValue and false. Calling any functions on the returned invalid instance may cause a panic.
func (Map) Len ¶
Len returns the length of this map.
Because the Map is represented internally by a slice of pointers, and the data are comping from the wire, it is possible that when iterating using "Range" to get access to fewer elements because nil elements are skipped.
func (Map) MoveTo ¶
MoveTo moves all key/values from the current map overriding the destination and resetting the current instance to its zero value
func (Map) PutBool ¶
PutBool performs the Insert or Update action. The bool Value is inserted to the map that did not originally have the key. The key/value is updated to the map where the key already existed.
func (Map) PutDouble ¶
PutDouble performs the Insert or Update action. The double Value is inserted to the map that did not originally have the key. The key/value is updated to the map where the key already existed.
func (Map) PutEmpty ¶
PutEmpty inserts or updates an empty value to the map under given key and return the updated/inserted value.
func (Map) PutEmptyBytes ¶
PutEmptyBytes inserts or updates an empty byte slice under given key and returns it.
func (Map) PutEmptyMap ¶
PutEmptyMap inserts or updates an empty map under given key and returns it.
func (Map) PutEmptySlice ¶
PutEmptySlice inserts or updates an empty slice under given key and returns it.
func (Map) PutInt ¶
PutInt performs the Insert or Update action. The int Value is inserted to the map that did not originally have the key. The key/value is updated to the map where the key already existed.
func (Map) PutStr ¶
PutStr performs the Insert or Update action. The Value is inserted to the map that did not originally have the key. The key/value is updated to the map where the key already existed.
func (Map) Range ¶
Range calls f sequentially for each key and value present in the map. If f returns false, range stops the iteration.
Example:
sm.Range(func(k string, v Value) bool {
...
})
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.
func NewResource ¶
func NewResource() Resource
NewResource creates a new empty Resource.
This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.
func (Resource) Attributes ¶
Attributes returns the Attributes associated with this Resource.
func (Resource) CopyTo ¶
CopyTo copies all properties from the current struct overriding the destination.
func (Resource) DroppedAttributesCount ¶
DroppedAttributesCount returns the droppedattributescount associated with this Resource.
func (Resource) MoveTo ¶
MoveTo moves all properties from the current struct overriding the destination and resetting the current instance to its zero value
func (Resource) SetDroppedAttributesCount ¶
SetDroppedAttributesCount replaces the droppedattributescount associated with this Resource.
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.
func NewSlice ¶
func NewSlice() Slice
NewSlice creates a Slice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.
func (Slice) All ¶
All returns an iterator over index-value pairs in the slice.
for i, v := range es.All() {
... // Do something with index-value pair
}
func (Slice) AppendEmpty ¶
AppendEmpty will append to the end of the slice an empty Value. It returns the newly added Value.
func (Slice) At ¶
At returns the element at the given index.
This function is used mostly for iterating over all the values in the slice:
for i := 0; i < es.Len(); i++ {
e := es.At(i)
... // Do something with the element
}
func (Slice) EnsureCapacity ¶
EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.
Here is how a new Slice can be initialized:
es := NewSlice()
es.EnsureCapacity(4)
for i := 0; i < 4; i++ {
e := es.AppendEmpty()
// Here should set all the values for e.
}
func (Slice) Len ¶
Len returns the number of elements in the slice.
Returns "0" for a newly instance created with "NewSlice()".
func (Slice) MoveAndAppendTo ¶
MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.
type SpanID ¶
type SpanID [8]byte
SpanID is span identifier.
func NewSpanIDEmpty ¶
func NewSpanIDEmpty() SpanID
NewSpanIDEmpty returns a new empty (all zero bytes) SpanID.
type StringSlice ¶
type StringSlice internal.StringSlice
StringSlice represents a []string slice. The instance of StringSlice can be assigned to multiple objects since it's immutable.
Must use NewStringSlice function to create new instances. Important: zero-initialized instance is not valid for use.
func NewStringSlice ¶
func NewStringSlice() StringSlice
NewStringSlice creates a new empty StringSlice.
func (StringSlice) All ¶
func (ms StringSlice) All() iter.Seq2[int, string]
All returns an iterator over index-value pairs in the slice.
func (StringSlice) Append ¶
func (ms StringSlice) Append(elms ...string)
Append appends extra elements to StringSlice. Equivalent of stringSlice = append(stringSlice, elms...)
func (StringSlice) AsRaw ¶
func (ms StringSlice) AsRaw() []string
AsRaw returns a copy of the []string slice.
func (StringSlice) At ¶
func (ms StringSlice) At(i int) string
At returns an item from particular index. Equivalent of stringSlice[i].
func (StringSlice) CopyTo ¶
func (ms StringSlice) CopyTo(dest StringSlice)
CopyTo copies all elements from the current slice overriding the destination.
func (StringSlice) EnsureCapacity ¶
func (ms StringSlice) EnsureCapacity(newCap int)
EnsureCapacity ensures StringSlice has at least the specified capacity.
- If the newCap <= cap, then is no change in capacity.
- If the newCap > cap, then the slice capacity will be expanded to the provided value which will be equivalent of: buf := make([]string, len(stringSlice), newCap) copy(buf, stringSlice) stringSlice = buf
func (StringSlice) Equal ¶
func (ms StringSlice) Equal(val StringSlice) bool
Equal checks equality with another StringSlice
func (StringSlice) FromRaw ¶
func (ms StringSlice) FromRaw(val []string)
FromRaw copies raw []string into the slice StringSlice.
func (StringSlice) Len ¶
func (ms StringSlice) Len() int
Len returns length of the []string slice value. Equivalent of len(stringSlice).
func (StringSlice) MoveAndAppendTo ¶
func (ms StringSlice) MoveAndAppendTo(dest StringSlice)
MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.
func (StringSlice) MoveTo ¶
func (ms StringSlice) MoveTo(dest StringSlice)
MoveTo moves all elements from the current slice overriding the destination and resetting the current instance to its zero value.
func (StringSlice) SetAt ¶
func (ms StringSlice) SetAt(i int, val string)
SetAt sets string item at particular index. Equivalent of stringSlice[i] = val
type Timestamp ¶
type Timestamp uint64
Timestamp is a time specified as UNIX Epoch time in nanoseconds since 1970-01-01 00:00:00 +0000 UTC.
func NewTimestampFromTime ¶
NewTimestampFromTime constructs a new Timestamp from the provided time.Time.
type TraceID ¶
type TraceID [16]byte
TraceID is a trace identifier.
func NewTraceIDEmpty ¶
func NewTraceIDEmpty() TraceID
NewTraceIDEmpty returns a new empty (all zero bytes) TraceID.
type TraceState ¶
type TraceState internal.TraceState
TraceState represents the trace state from the w3c-trace-context.
Must use NewTraceState function to create new instances. Important: zero-initialized instance is not valid for use.
func NewTraceState ¶
func NewTraceState() TraceState
func (TraceState) AsRaw ¶
func (ms TraceState) AsRaw() string
AsRaw returns the string representation of the tracestate in w3c-trace-context format: https://www.w3.org/TR/trace-context/#tracestate-header
func (TraceState) CopyTo ¶
func (ms TraceState) CopyTo(dest TraceState)
CopyTo copies the TraceState instance overriding the destination.
func (TraceState) FromRaw ¶
func (ms TraceState) FromRaw(v string)
FromRaw copies the string representation in w3c-trace-context format of the tracestate into this TraceState.
func (TraceState) MoveTo ¶
func (ms TraceState) MoveTo(dest TraceState)
MoveTo moves the TraceState instance overriding the destination and resetting the current instance to its zero value.
type UInt64Slice ¶
type UInt64Slice internal.UInt64Slice
UInt64Slice represents a []uint64 slice. The instance of UInt64Slice can be assigned to multiple objects since it's immutable.
Must use NewUInt64Slice function to create new instances. Important: zero-initialized instance is not valid for use.
func NewUInt64Slice ¶
func NewUInt64Slice() UInt64Slice
NewUInt64Slice creates a new empty UInt64Slice.
func (UInt64Slice) All ¶
func (ms UInt64Slice) All() iter.Seq2[int, uint64]
All returns an iterator over index-value pairs in the slice.
func (UInt64Slice) Append ¶
func (ms UInt64Slice) Append(elms ...uint64)
Append appends extra elements to UInt64Slice. Equivalent of uInt64Slice = append(uInt64Slice, elms...)
func (UInt64Slice) AsRaw ¶
func (ms UInt64Slice) AsRaw() []uint64
AsRaw returns a copy of the []uint64 slice.
func (UInt64Slice) At ¶
func (ms UInt64Slice) At(i int) uint64
At returns an item from particular index. Equivalent of uInt64Slice[i].
func (UInt64Slice) CopyTo ¶
func (ms UInt64Slice) CopyTo(dest UInt64Slice)
CopyTo copies all elements from the current slice overriding the destination.
func (UInt64Slice) EnsureCapacity ¶
func (ms UInt64Slice) EnsureCapacity(newCap int)
EnsureCapacity ensures UInt64Slice has at least the specified capacity.
- If the newCap <= cap, then is no change in capacity.
- If the newCap > cap, then the slice capacity will be expanded to the provided value which will be equivalent of: buf := make([]uint64, len(uInt64Slice), newCap) copy(buf, uInt64Slice) uInt64Slice = buf
func (UInt64Slice) Equal ¶
func (ms UInt64Slice) Equal(val UInt64Slice) bool
Equal checks equality with another UInt64Slice
func (UInt64Slice) FromRaw ¶
func (ms UInt64Slice) FromRaw(val []uint64)
FromRaw copies raw []uint64 into the slice UInt64Slice.
func (UInt64Slice) Len ¶
func (ms UInt64Slice) Len() int
Len returns length of the []uint64 slice value. Equivalent of len(uInt64Slice).
func (UInt64Slice) MoveAndAppendTo ¶
func (ms UInt64Slice) MoveAndAppendTo(dest UInt64Slice)
MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.
func (UInt64Slice) MoveTo ¶
func (ms UInt64Slice) MoveTo(dest UInt64Slice)
MoveTo moves all elements from the current slice overriding the destination and resetting the current instance to its zero value.
func (UInt64Slice) SetAt ¶
func (ms UInt64Slice) SetAt(i int, val uint64)
SetAt sets uint64 item at particular index. Equivalent of uInt64Slice[i] = val
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.SetInt(234) }
func f2() {
v := NewValueStr("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.
func NewValueBool ¶
NewValueBool creates a new Value with the given bool value.
func NewValueBytes ¶
func NewValueBytes() Value
NewValueBytes creates a new empty Value of byte type.
func NewValueDouble ¶
NewValueDouble creates a new Value with the given float64 value.
func NewValueEmpty ¶
func NewValueEmpty() Value
NewValueEmpty creates a new Value with an empty value.
func NewValueInt ¶
NewValueInt creates a new Value with the given int64 value.
func NewValueStr ¶
NewValueStr creates a new Value with the given string value.
func (Value) AsString ¶
AsString converts an OTLP Value object of any type to its equivalent string representation. This differs from Str which only returns a non-empty value if the ValueType is ValueTypeStr. Calling this function on zero-initialized Value will cause a panic.
func (Value) Bool ¶
Bool returns the bool value associated with this Value. If the Type() is not ValueTypeBool then returns false.
func (Value) Bytes ¶
Bytes returns the ByteSlice value associated with this Value. If the function is called on zero-initialized Value or if the Type() is not ValueTypeBytes then returns an invalid ByteSlice object. Note that using such slice can cause panic.
func (Value) CopyTo ¶
CopyTo copies the Value instance overriding the destination. Calling this function on zero-initialized Value will cause a panic.
func (Value) Double ¶
Double returns the float64 value associated with this Value. If the Type() is not ValueTypeDouble then returns float64(0).
func (Value) FromRaw ¶
FromRaw sets the value from the given raw value. Calling this function on zero-initialized Value will cause a panic.
func (Value) Int ¶
Int returns the int64 value associated with this Value. If the Type() is not ValueTypeInt then returns int64(0).
func (Value) Map ¶
Map returns the map value associated with this Value. If the function is called on zero-initialized Value or if the Type() is not ValueTypeMap then it returns an invalid map. Note that using such map can cause panic.
func (Value) MoveTo ¶
MoveTo moves the Value from current overriding the destination and resetting the current instance to empty value. Calling this function on zero-initialized Value will cause a panic.
func (Value) SetBool ¶
SetBool replaces the bool value associated with this Value, it also changes the type to be ValueTypeBool. Calling this function on zero-initialized Value will cause a panic.
func (Value) SetDouble ¶
SetDouble replaces the float64 value associated with this Value, it also changes the type to be ValueTypeDouble. Calling this function on zero-initialized Value will cause a panic.
func (Value) SetEmptyBytes ¶
SetEmptyBytes sets value to an empty byte slice and returns it. Calling this function on zero-initialized Value will cause a panic.
func (Value) SetEmptyMap ¶
SetEmptyMap sets value to an empty map and returns it. Calling this function on zero-initialized Value will cause a panic.
func (Value) SetEmptySlice ¶
SetEmptySlice sets value to an empty slice and returns it. Calling this function on zero-initialized Value will cause a panic.
func (Value) SetInt ¶
SetInt replaces the int64 value associated with this Value, it also changes the type to be ValueTypeInt. Calling this function on zero-initialized Value will cause a panic.
func (Value) SetStr ¶
SetStr replaces the string value associated with this Value, it also changes the type to be ValueTypeStr. The shorter name is used instead of SetString to avoid implementing fmt.Stringer interface by the corresponding getter method. Calling this function on zero-initialized Value will cause a panic.
func (Value) Slice ¶
Slice returns the slice value associated with this Value. If the function is called on zero-initialized Value or if the Type() is not ValueTypeSlice then returns an invalid slice. Note that using such slice can cause panic.