diagnostics

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package diagnostics renders safe typed events for the CLI-owned stderr presenter. Event definitions and emission remain in shared/diagnostics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Presenter

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

Presenter renders typed events as safe text or one-line JSON records.

func NewPresenter

func NewPresenter(writer io.Writer) *Presenter

NewPresenter creates a text presenter using the local clock.

func NewPresenterWithClock

func NewPresenterWithClock(writer io.Writer, now func() time.Time) *Presenter

NewPresenterWithClock is deterministic-test friendly while preserving the production text rendering path.

func NewPresenterWithFormat

func NewPresenterWithFormat(writer io.Writer, format string, now func() time.Time) *Presenter

NewPresenterWithFormat creates a presenter for the configured stderr format.

func (*Presenter) Emit

func (p *Presenter) Emit(event core.Event)

Emit renders and writes one complete record. The first writer error is kept; business execution is never cancelled by a diagnostic sink failure.

func (*Presenter) Err

func (p *Presenter) Err() error

Err returns the first writer or rendering error observed by the presenter.

Jump to

Keyboard shortcuts

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