Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ValidationScopes = []ValidationScope{GroupScope, AlertScope, RecordingRuleScope, AllRulesScope}
Functions ¶
func BaseDirPath ¶
func BaseDirPath() string
Types ¶
type Config ¶
type Config struct { CustomExcludeAnnotation string `yaml:"customExcludeAnnotation"` CustomDisableComment string `yaml:"customDisableComment"` ValidationRules []ValidationRule `yaml:"validationRules"` Prometheus PrometheusConfig `yaml:"prometheus"` }
type PrometheusConfig ¶
type PrometheusConfig struct { URL string `yaml:"url"` Timeout time.Duration `yaml:"timeout" default:"30s"` InsecureSkipTLSVerify bool `yaml:"insecureSkipTlsVerify"` CacheFile string `yaml:"cacheFile,omitempty" default:".promruval_cache.json"` MaxCacheAge time.Duration `yaml:"maxCacheAge,omitempty" default:"1h"` BearerTokenFile string `yaml:"bearerTokenFile,omitempty"` QueryOffset time.Duration `yaml:"queryOffset,omitempty" default:"1m"` QueryLookback time.Duration `yaml:"queryLookback,omitempty" default:"20m"` }
func (*PrometheusConfig) UnmarshalYAML ¶
func (c *PrometheusConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
type ValidationRule ¶
type ValidationRule struct { Name string `yaml:"name"` Scope ValidationScope `yaml:"scope"` Validations []ValidatorConfig `yaml:"validations"` }
type ValidationScope ¶
type ValidationScope string
const ( AlertScope ValidationScope = "Alert" RecordingRuleScope ValidationScope = "Recording rule" AllRulesScope ValidationScope = "All rules" GroupScope ValidationScope = "Group" AllScope ValidationScope = "All" )
func (*ValidationScope) UnmarshalYAML ¶
func (t *ValidationScope) UnmarshalYAML(unmarshal func(interface{}) error) error
type ValidatorConfig ¶
type ValidatorConfig struct { ValidatorType string `yaml:"type"` AdditionalDetails string `yaml:"additionalDetails"` Params yaml.Node `yaml:"params"` ParamsFromFile string `yaml:"paramsFromFile"` }
func (*ValidatorConfig) UnmarshalYAML ¶
func (c *ValidatorConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
Click to show internal directories.
Click to hide internal directories.