validator

package
v0.0.0-...-9b5cd94 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrTypeUndefined = iota
	ErrTypeUnexpectedBlock
	ErrTypeUnexpectedSymbol
	ErrTypeUnexpectedFunction
	ErrTypeUnexpectedEOF
)
View Source
const (
	WrnTypeOutsideBlockVar = iota
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrReport

type ErrReport struct {
	Line int `json:"line"`

	// Possible error type values.
	//   * `0` - Undefined error
	//   * `1` - Unexpected block
	//   * `2` - Unexpected symbol
	//   * `3` - Unexpected function
	//   * `4` - Unexpected EOF
	Type    int    `json:"type"`
	Message string `json:"message"`

	// Var is defined only for template exec errors
	Var string `json:"var,omitempty"`
}

type RegexpInfo

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

type Validator

type Validator interface {
	ValidateDeclareTicketRuleTemplate(s string) (bool, *ErrReport, []WrnReport, error)
	ValidateScenarioTemplate(s string) (bool, *ErrReport, []WrnReport, error)
	ValidateEventFilterRuleTemplate(s string) (bool, *ErrReport, []WrnReport, error)
}

func NewValidator

func NewValidator(timezoneConfigProvider config.TimezoneConfigProvider) Validator

type WrnReport

type WrnReport struct {
	// Possible warning type values.
	//   * `0` - Might be unfinished variable block
	Type int `json:"type"`

	Message string `json:"message"`
	Var     string `json:"var,omitempty"`
}

Jump to

Keyboard shortcuts

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