Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Diagnostic ¶
type Diagnostic struct {
// contains filtered or unexported fields
}
func NewDiagnostic ¶
func NewDiagnostic( level DiagnosticLevel, position parser.PositionRange, message string, ) Diagnostic
type DiagnosticLevel ¶
type DiagnosticLevel uint
const ( DiagnosticLevelInfo DiagnosticLevel = iota DiagnosticLevelWarning DiagnosticLevelError )
func (DiagnosticLevel) String ¶
func (d DiagnosticLevel) String() string
String implements fmt.Stringer
type Diagnostics ¶
type Diagnostics struct {
// contains filtered or unexported fields
}
func NewDiagnostics ¶
func NewDiagnostics() *Diagnostics
func (*Diagnostics) Add ¶
func (ds *Diagnostics) Add(d Diagnostic)
type PromQLinter ¶
type PromQLinter struct {
// contains filtered or unexported fields
}
func New ¶
func New(options ...PromQLinterOption) *PromQLinter
func (*PromQLinter) Execute ¶
func (pq *PromQLinter) Execute( rawExpr string, filter DiagnosticLevel, ) (bool, error)
type PromQLinterOption ¶
type PromQLinterOption func(*PromQLinter)
func WithOutStream ¶
func WithOutStream(out io.Writer) PromQLinterOption
func WithPlugin ¶
func WithPlugin(plugin PromQLinterPlugin) PromQLinterOption
func WithPlugins ¶
func WithPlugins(plugins ...PromQLinterPlugin) PromQLinterOption
type PromQLinterPlugin ¶
type PromQLinterPlugin interface { // Name represents the name of the plugin. // the name is used in the reporting message from the linter. Name() string // Execute lints the PromQL expression. Execute(expr parser.Expr) (*Diagnostics, error) }
Click to show internal directories.
Click to hide internal directories.