Documentation
¶
Overview ¶
Package diag exposes error types used throughout converter and a method to pretty-print them to the screen.
Package diag exposes error types used throughout converter and a method to pretty-print them to the screen.
Package diag exposes error types used throughout converter and a method to pretty-print them to the screen.
Index ¶
- Constants
- type Diagnostic
- type Diagnostics
- func (ds *Diagnostics) Add(severity Severity, message string)
- func (ds *Diagnostics) AddAll(diags Diagnostics)
- func (ds *Diagnostics) AddWithDetail(severity Severity, message string, detail string)
- func (ds Diagnostics) Error() string
- func (ds Diagnostics) GenerateReport(writer io.Writer, reportType string) error
- func (ds *Diagnostics) RemoveDiagsBySeverity(severity Severity)
- type Severity
Constants ¶
const Text = ".txt"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Diagnostic ¶
type Diagnostic struct { // Severity holds the severity level of this Diagnostic. Severity Severity Summary string Detail string }
Diagnostic is an individual diagnostic message. Diagnostic messages can have different levels of severities.
func (Diagnostic) String ¶ added in v0.35.0
func (d Diagnostic) String() string
type Diagnostics ¶
type Diagnostics []Diagnostic
Diagnostics is a collection of diagnostic messages.
func (*Diagnostics) Add ¶
func (ds *Diagnostics) Add(severity Severity, message string)
Add adds an individual Diagnostic to the diagnostics list.
func (*Diagnostics) AddAll ¶ added in v0.36.0
func (ds *Diagnostics) AddAll(diags Diagnostics)
AddAll adds all given diagnostics to the diagnostics list.
func (*Diagnostics) AddWithDetail ¶ added in v0.35.0
func (ds *Diagnostics) AddWithDetail(severity Severity, message string, detail string)
Add adds an individual Diagnostic to the diagnostics list.
func (Diagnostics) Error ¶ added in v0.35.0
func (ds Diagnostics) Error() string
Error implements error.
func (Diagnostics) GenerateReport ¶ added in v0.35.0
func (ds Diagnostics) GenerateReport(writer io.Writer, reportType string) error
func (*Diagnostics) RemoveDiagsBySeverity ¶ added in v0.35.0
func (ds *Diagnostics) RemoveDiagsBySeverity(severity Severity)