xpdata

package module
v0.162.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONMarshaler added in v0.136.0

type JSONMarshaler struct{}

func (*JSONMarshaler) MarshalValue added in v0.138.0

func (*JSONMarshaler) MarshalValue(value pcommon.Value) ([]byte, error)

type JSONUnmarshaler added in v0.136.0

type JSONUnmarshaler struct {
	// DisallowUnknownFields causes UnmarshalValue to return an error when the
	// input contains JSON object fields that are not defined by the OTLP
	// schema. When false (the default), unknown fields are silently ignored.
	//
	// Warning: enabling this option breaks forwards compatibility with future
	// evolutions of the OTLP format, as fields added to the format in newer
	// versions will be rejected as unknown.
	DisallowUnknownFields bool
	// contains filtered or unexported fields
}

func (*JSONUnmarshaler) UnmarshalValue added in v0.138.0

func (u *JSONUnmarshaler) UnmarshalValue(buf []byte) (pcommon.Value, error)

type MapBuilder

type MapBuilder struct {
	// contains filtered or unexported fields
}

MapBuilder is an experimental struct which can be used to create a pcommon.Map more efficiently than by repeated use of the Put family of methods, which check for duplicate keys on every call (a linear time operation). A zero-initialized MapBuilder is ready for use.

func (*MapBuilder) AppendEmpty

func (mb *MapBuilder) AppendEmpty(k string) pcommon.Value

AppendEmpty appends a key/value pair to the MapBuilder and return the inserted value. This method does not check for duplicate keys and has an amortized constant time complexity.

func (*MapBuilder) EnsureCapacity

func (mb *MapBuilder) EnsureCapacity(capacity int)

EnsureCapacity increases the capacity of this MapBuilder instance, if necessary, to ensure that it can hold at least the number of elements specified by the capacity argument.

func (*MapBuilder) UnsafeIntoMap

func (mb *MapBuilder) UnsafeIntoMap(m pcommon.Map)

UnsafeIntoMap transfers the contents of a MapBuilder into a MapWrapper, without checking for duplicate keys. If the MapBuilder contains duplicate keys, the behavior of the resulting MapWrapper is unspecified. This operation has constant time complexity and makes no allocations. After this operation, the MapBuilder is reset to an empty state.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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