backend

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package backend provides sync backend implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsoleBackend

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

ConsoleBackend outputs spans to the console for testing.

func NewConsoleBackend

func NewConsoleBackend(config ConsoleConfig) *ConsoleBackend

NewConsoleBackend creates a new console backend.

func (*ConsoleBackend) Close

func (c *ConsoleBackend) Close() error

Close is a no-op for console backend.

func (*ConsoleBackend) Flush

func (c *ConsoleBackend) Flush(ctx context.Context) error

Flush is a no-op for console backend.

func (*ConsoleBackend) Name

func (c *ConsoleBackend) Name() string

Name returns "console".

func (*ConsoleBackend) SendBatch

func (c *ConsoleBackend) SendBatch(ctx context.Context, batch *sync.SpanBatch) error

SendBatch outputs a batch of spans.

func (*ConsoleBackend) SendSpan

func (c *ConsoleBackend) SendSpan(ctx context.Context, span *sync.Span) error

SendSpan outputs a span to the console.

func (*ConsoleBackend) Stats

func (c *ConsoleBackend) Stats() Stats

Stats returns backend statistics.

type ConsoleConfig

type ConsoleConfig struct {
	Writer  io.Writer
	Verbose bool
	Format  string // "text" or "json"
	NoColor bool
}

ConsoleConfig configures the console backend.

func DefaultConsoleConfig

func DefaultConsoleConfig() ConsoleConfig

DefaultConsoleConfig returns default console configuration.

type Stats

type Stats struct {
	SpansSent   int
	SpansFailed int
	BytesSent   int64
}

Stats holds backend statistics.

Jump to

Keyboard shortcuts

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