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, bypassErrors bool) error
- func (ds *Diagnostics) HasSeverityLevel(severity Severity) bool
- 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 ¶
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 ¶
func (ds *Diagnostics) AddAll(diags Diagnostics)
AddAll adds all given diagnostics to the diagnostics list.
func (*Diagnostics) AddWithDetail ¶
func (ds *Diagnostics) AddWithDetail(severity Severity, message string, detail string)
Add adds an individual Diagnostic to the diagnostics list.
func (Diagnostics) GenerateReport ¶
func (*Diagnostics) HasSeverityLevel ¶
func (ds *Diagnostics) HasSeverityLevel(severity Severity) bool
func (*Diagnostics) RemoveDiagsBySeverity ¶
func (ds *Diagnostics) RemoveDiagsBySeverity(severity Severity)