view

package
v0.63.5 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HumanRender

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

func (*HumanRender) Diagnostic

func (render *HumanRender) Diagnostic(diag *diagnostic.Diagnostic) (string, error)

Diagnostic formats a single diagnostic message.

func (*HumanRender) Diagnostics

func (render *HumanRender) Diagnostics(diags diagnostic.Diagnostics) (string, error)

func (*HumanRender) InvalidConfigPath

func (render *HumanRender) InvalidConfigPath(filenames []string) (string, error)

func (*HumanRender) SourceSnippets

func (render *HumanRender) SourceSnippets(diag *diagnostic.Diagnostic) (string, error)

type JSONRender

type JSONRender struct{}

func (*JSONRender) Diagnostics

func (render *JSONRender) Diagnostics(diags diagnostic.Diagnostics) (string, error)

func (*JSONRender) InvalidConfigPath

func (render *JSONRender) InvalidConfigPath(filenames []string) (string, error)

type Render

type Render interface {
	// Diagnostics renders early diagnostics, resulting from argument parsing.
	Diagnostics(diags diagnostic.Diagnostics) (string, error)

	// InvalidConfigPath renders paths to configurations that contain errors.
	InvalidConfigPath(filenames []string) (string, error)
}

func NewHumanRender

func NewHumanRender(disableColor bool) Render

func NewJSONRender

func NewJSONRender() Render

type Writer

type Writer struct {
	io.Writer
	// contains filtered or unexported fields
}

Writer is the base layer for command views, encapsulating a set of I/O streams, a colorize implementation, and implementing a human friendly view for diagnostics.

func NewWriter

func NewWriter(writer io.Writer, render Render) *Writer

func (*Writer) Diagnostics

func (writer *Writer) Diagnostics(diags diagnostic.Diagnostics) error

func (*Writer) InvalidConfigPath

func (writer *Writer) InvalidConfigPath(diags diagnostic.Diagnostics) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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