adapter

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSemaphore

func NewSemaphore(size int) *semaphore

NewSemaphore creates a new semaphore with the given size.

Types

type Logger

type Logger interface {
	Info(msg string, fields map[string]interface{})  // Info logs an informational message with optional fields.
	Error(msg string, fields map[string]interface{}) // Error logs an error message with optional fields.
	Debug(msg string, fields map[string]interface{}) // Debug logs a debug message with optional fields.
	WithSpanContext(spanContext SpanContext) Logger  // WithSpanContext returns a logger with span context for correlation.
}

Logger interface for optional observability.

func NewNoOpLogger

func NewNoOpLogger() Logger

NewNoOpLogger creates a new no-op logger.

type NoOpLogger

type NoOpLogger struct{}

func (*NoOpLogger) Debug

func (n *NoOpLogger) Debug(msg string, fields map[string]interface{})

Debug does nothing.

func (*NoOpLogger) Error

func (n *NoOpLogger) Error(msg string, fields map[string]interface{})

Error does nothing.

func (*NoOpLogger) Info

func (n *NoOpLogger) Info(msg string, fields map[string]interface{})

Info does nothing.

func (*NoOpLogger) WithSpanContext

func (n *NoOpLogger) WithSpanContext(spanContext SpanContext) Logger

WithSpanContext returns the same no-op logger.

type NoOpSpan

type NoOpSpan struct{}

func (*NoOpSpan) AddEvent

func (n *NoOpSpan) AddEvent(name string, attrs ...SpanAttribute)

AddEvent does nothing.

func (*NoOpSpan) End

func (n *NoOpSpan) End()

End does nothing.

func (*NoOpSpan) SetAttributes

func (n *NoOpSpan) SetAttributes(attrs ...SpanAttribute)

SetAttributes does nothing.

func (*NoOpSpan) SpanContext

func (n *NoOpSpan) SpanContext() SpanContext

SpanContext returns a no-op span context.

type NoOpSpanAttribute

type NoOpSpanAttribute struct{}

type NoOpSpanContext

type NoOpSpanContext struct{}

func (*NoOpSpanContext) SpanID

func (n *NoOpSpanContext) SpanID() string

SpanID returns an empty string.

func (*NoOpSpanContext) TraceID

func (n *NoOpSpanContext) TraceID() string

TraceID returns an empty string.

type NoOpTracer

type NoOpTracer struct{}

No Operation Tracer implementation.

func (*NoOpTracer) NewSpanFromSpan

func (n *NoOpTracer) NewSpanFromSpan(ctx context.Context, name string, parent Span) (context.Context, Span)

NewSpanFromSpan creates a no-op child span.

func (*NoOpTracer) NewStringAttribute

func (n *NoOpTracer) NewStringAttribute(key string, value string) SpanAttribute

NewStringAttribute creates a no-op string attribute.

func (*NoOpTracer) StartSpan

func (n *NoOpTracer) StartSpan(ctx context.Context, name string) (context.Context, Span)

StartSpan starts a no-op span.

type Semaphore

type Semaphore interface {
	Size() int // Size returns the size of the semaphore.
	Acquire()  // Acquire acquires a semaphore permit, blocking if necessary.
	Release()  // Release releases a semaphore permit.
}

Semaphore interface for concurrency control.

type Span

type Span interface {
	End()                                         // End finishes the span.
	AddEvent(name string, attrs ...SpanAttribute) // AddEvent adds an event to the span.
	SetAttributes(attrs ...SpanAttribute)         // SetAttributes sets attributes on the span.
	SpanContext() SpanContext                     // SpanContext returns the span context for propagation.
}

Span represents a tracing span.

type SpanAttribute

type SpanAttribute interface{}

SpanAttribute represents a span attribute.

type SpanContext

type SpanContext interface {
	TraceID() string // TraceID returns the trace ID.
	SpanID() string  // SpanID returns the span ID.
}

SpanContext represents span context for propagation.

type Tracer

type Tracer interface {
	StartSpan(ctx context.Context, name string) (context.Context, Span)                    // StartSpan starts a new span with the given name. Returns a context with the span and the span itself.
	NewSpanFromSpan(ctx context.Context, name string, parent Span) (context.Context, Span) // NewSpanFromSpan creates a new span from an existing span (child span). Returns a context with the new span and the span itself.
}

Tracer interface for optional observability.

func NewNoOpTracer

func NewNoOpTracer() Tracer

NewNoOpTracer creates a new no-op tracer.

Jump to

Keyboard shortcuts

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