internal

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrIncorrectRecord = fmt.Errorf("received incorrect record")

Functions

func KeyAsAttribute

func KeyAsAttribute(name string, key string) attribute.KeyValue

KeyAsAttribute 函数将 DHT 键格式化为适合跟踪的属性。 DHT 键可以是有效的 UTF-8 字符串,也可以是二进制数据,例如从 Multihash 导出的键。 跟踪(特别是 OpenTelemetry+grpc 导出器)要求字符串属性使用有效的 UTF-8 字符串。

func StartSpan

func StartSpan(ctx context.Context, name string, opts ...trace.SpanStartOption) (context.Context, trace.Span)

StartSpan 函数用于启动一个跨度(span)。 它接收一个上下文(context.Context)对象、一个跨度名称(name)和一些跨度启动选项(opts)作为输入参数。 返回更新后的上下文对象和一个跨度对象。

Types

type CtxMutex

type CtxMutex chan struct{}

func NewCtxMutex

func NewCtxMutex() CtxMutex

func (CtxMutex) Lock

func (m CtxMutex) Lock(ctx context.Context) error

func (CtxMutex) Unlock

func (m CtxMutex) Unlock()

type LoggableProviderRecordBytes

type LoggableProviderRecordBytes []byte

func (LoggableProviderRecordBytes) String

func (lk LoggableProviderRecordBytes) String() string

type LoggableRecordKeyBytes

type LoggableRecordKeyBytes []byte

func (LoggableRecordKeyBytes) String

func (lk LoggableRecordKeyBytes) String() string

type LoggableRecordKeyString

type LoggableRecordKeyString string

func (LoggableRecordKeyString) String

func (lk LoggableRecordKeyString) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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