diagnostic

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodePluginUnsupported = "plugin.unsupported"
	CodePluginFailed      = "plugin.failed"
	CodePluginUnspecified = "plugin.unspecified"
)

Variables

This section is empty.

Functions

func StableCode

func StableCode(diag Diagnostic) string

Types

type Diagnostic

type Diagnostic struct {
	Code       string     `json:"code,omitempty" yaml:"code,omitempty"`
	Severity   Severity   `json:"severity" yaml:"severity"`
	Category   string     `json:"category" yaml:"category"`
	Message    string     `json:"message" yaml:"message"`
	Provenance Provenance `json:"provenance,omitempty" yaml:"provenance,omitempty"`
}

func WithStableCodes

func WithStableCodes(diags []Diagnostic) []Diagnostic

type Provenance

type Provenance struct {
	Path    string `json:"path,omitempty" yaml:"path,omitempty"`
	Pointer string `json:"pointer,omitempty" yaml:"pointer,omitempty"`
}

type Reporter

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

func NewReporter

func NewReporter(strict bool) *Reporter

func (*Reporter) All

func (r *Reporter) All() []Diagnostic

func (*Reporter) Error

func (r *Reporter) Error(category, message string, provenance Provenance)

func (*Reporter) HasErrors

func (r *Reporter) HasErrors() bool

func (*Reporter) Warn

func (r *Reporter) Warn(category, message string, provenance Provenance)

type Severity

type Severity string
const (
	SeverityWarning Severity = "warning"
	SeverityError   Severity = "error"
)

Jump to

Keyboard shortcuts

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