pcommon

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2022 License: Apache-2.0 Imports: 1 Imported by: 493

Documentation

Index

Constants

View Source
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

View Source
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 []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.
	NewValueBytes = internal.NewValueBytes
)
View Source
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
)
View Source
var InvalidSpanID = internal.InvalidSpanID

InvalidSpanID returns an empty (all zero bytes) SpanID.

View Source
var InvalidTraceID = internal.InvalidTraceID

InvalidTraceID returns an empty (all zero bytes) TraceID.

View Source
var NewInstrumentationScope = internal.NewInstrumentationScope

NewInstrumentationScope is an alias for a function to create a new empty InstrumentationScope.

View Source
var NewResource = internal.NewResource

NewResource is an alias for a function to create a new empty Resource.

View Source
var NewSlice = internal.NewSlice

NewSlice creates a Slice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.

View Source
var NewSpanID = internal.NewSpanID

NewSpanID returns a new SpanID from the given byte array.

View Source
var NewTimestampFromTime = internal.NewTimestampFromTime

NewTimestampFromTime constructs a new Timestamp from the provided time.Time.

View Source
var NewTraceID = internal.NewTraceID

NewTraceID returns a new TraceID from the given byte array.

Functions

This section is empty.

Types

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 Map

type Map = internal.Map

Map stores a map of string keys to elements of Value type.

type Resource

type Resource = internal.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

type Slice = internal.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 SpanID

type SpanID = internal.SpanID

SpanID is span identifier.

type Timestamp

type Timestamp = internal.Timestamp

Timestamp is a time specified as UNIX Epoch time in nanoseconds since 1970-01-01 00:00:00 +0000 UTC.

type TraceID

type TraceID = internal.TraceID

TraceID is a trace identifier.

type Value

type Value = internal.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.

type ValueType

type ValueType = internal.ValueType

ValueType specifies the type of Value.

Jump to

Keyboard shortcuts

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