ui

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorMessage

type ErrorMessage struct {
	Error   error
	Message string
}

func (ErrorMessage) Log

func (m ErrorMessage) Log(logger *slog.Logger)

func (ErrorMessage) Print

func (m ErrorMessage) Print(printer *Printer)

type InfoMessage

type InfoMessage struct {
	Message string
}

func (InfoMessage) Log

func (m InfoMessage) Log(logger *slog.Logger)

func (InfoMessage) Print

func (m InfoMessage) Print(printer *Printer)

type InteractiveMessage

type InteractiveMessage struct {
	Message string
}

func (InteractiveMessage) Log

func (m InteractiveMessage) Log(*slog.Logger)

func (InteractiveMessage) Print

func (m InteractiveMessage) Print(printer *Printer)

type Output

type Output struct {
	Logger        *slog.Logger
	Printer       *Printer
	Interactive   bool
	AllowPrinting bool
}

func NewDefaultOutput

func NewDefaultOutput(logLevel slog.Level, jsonFormat bool) *Output

func NewDefaultOutputWithLogger

func NewDefaultOutputWithLogger(logger *slog.Logger) *Output

func NewDiscardOutput

func NewDiscardOutput() *Output

func NewOutput

func NewOutput(logger *slog.Logger, printer *Printer, interactive bool, allowPrinting bool) *Output

func (*Output) Display

func (o *Output) Display(outputable Outputable)

type Outputable

type Outputable interface {
	Print(printer *Printer)
	Log(logger *slog.Logger)
}

Outputable may be a type of message (like ErrorMessage, InfoMessage, etc) or github.com/form3tech-oss/f1/v2/internal/run/views.ViewContext

type Printer

type Printer struct {
	Writer    io.Writer
	ErrWriter io.Writer
}

func NewDefaultPrinter

func NewDefaultPrinter() *Printer

func NewDiscardPrinter

func NewDiscardPrinter() *Printer

func NewPrinter

func NewPrinter(writer io.Writer, errWriter io.Writer) *Printer

func (*Printer) Error

func (t *Printer) Error(a ...any)

func (*Printer) Println

func (t *Printer) Println(a ...any)

func (*Printer) Warn

func (t *Printer) Warn(a ...any)

type WarningMessage

type WarningMessage struct {
	Message string
}

func (WarningMessage) Log

func (m WarningMessage) Log(logger *slog.Logger)

func (WarningMessage) Print

func (m WarningMessage) Print(printer *Printer)

Jump to

Keyboard shortcuts

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