traceutil

package
v2.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DataSize

func DataSize(size int64) attribute.KeyValue

The size of the message data (from the 'DATA' SMTP command).

Type: int64 Required: Yes Examples: 1024

func InitTraceExporter

func InitTraceExporter(ctx context.Context, serviceName string, batchOptions ...sdktrace.BatchSpanProcessorOption) (closer func(context.Context) error, err error)

InitTraceExporter creates a new OTLP trace exporter and configures it as the global trace provider.

Use environment variables to configure the exporter, such as OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.

func Recipients

func Recipients(names []string) attribute.KeyValue

The recipient addresses (from the 'RCPT TO' SMTP command).

Type: []string Required: Yes Examples: ["alice@example", "<bob@example>"]

func Sender

func Sender(name string) attribute.KeyValue

The sender address (from the 'MAIL FROM' SMTP command).

Type: string Required: Yes Examples: "bob@example.com", "<alice@example.com>"

func StatusCode

func StatusCode(code int) attribute.KeyValue

The SMTP response status code.

Type: int Required: Yes Examples: 250

Types

type MIMEHeaderCarrier

type MIMEHeaderCarrier textproto.MIMEHeader

MIMEHeaderCarrier adapts textproto.MIMEHeader to satisfy the TextMapCarrier interface.

func (MIMEHeaderCarrier) Get

func (hc MIMEHeaderCarrier) Get(key string) string

Get returns the value associated with the passed key.

func (MIMEHeaderCarrier) Keys

func (hc MIMEHeaderCarrier) Keys() []string

Keys lists the keys stored in this carrier.

func (MIMEHeaderCarrier) Set

func (hc MIMEHeaderCarrier) Set(key string, value string)

Set stores the key-value pair.

Jump to

Keyboard shortcuts

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