config

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregateSettings

type AggregateSettings struct {
	Name     string   `hcl:",label"`
	Keep     []string `hcl:"keep,optional"`
	Strip    []string `hcl:"strip,optional"`
	Severity string   `hcl:"severity,optional"`
}

type AlertsSettings

type AlertsSettings struct {
	Range   string `hcl:"range"`
	Step    string `hcl:"step"`
	Resolve string `hcl:"resolve"`
}

type AnnotationSettings

type AnnotationSettings struct {
	Key      string `hcl:",label"`
	Value    string `hcl:"value,optional"`
	Required bool   `hcl:"required,optional"`
	Severity string `hcl:"severity,optional"`
}

type BitBucket

type BitBucket struct {
	URI        string `hcl:"uri"`
	Timeout    string `hcl:"timeout"`
	Project    string `hcl:"project"`
	Repository string `hcl:"repository"`
}

type CI

type CI struct {
	Include    []string `hcl:"include,optional"`
	MaxCommits int      `hcl:"maxCommits,optional"`
	BaseBranch string   `hcl:"baseBranch,optional"`
}

type Checks

type Checks struct {
	Enabled  []string `hcl:"enabled,optional"`
	Disabled []string `hcl:"disabled,optional"`
}

type ComparisonSettings

type ComparisonSettings struct {
	Severity string `hcl:"severity,optional"`
}

type Config

type Config struct {
	CI         *CI                `hcl:"ci,block"`
	Repository *Repository        `hcl:"repository,block"`
	Prometheus []PrometheusConfig `hcl:"prometheus,block"`
	Checks     *Checks            `hcl:"checks,block"`
	Rules      []Rule             `hcl:"rule,block"`
}

func Load

func Load(path string, failOnMissing bool) (cfg Config, err error)

func (Config) GetChecksForRule

func (cfg Config) GetChecksForRule(path string, r parser.Rule) []checks.RuleChecker

func (*Config) SetDisabledChecks

func (cfg *Config) SetDisabledChecks(l []string)

func (Config) String

func (cfg Config) String() string

type CostSettings

type CostSettings struct {
	BytesPerSample int    `hcl:"bytesPerSample,optional"`
	MaxSeries      int    `hcl:"maxSeries,optional"`
	Severity       string `hcl:"severity,optional"`
}

type GitHub

type GitHub struct {
	BaseURI   *string `hcl:"baseuri"`
	UploadURI *string `hcl:"uploaduri"`
	Timeout   string  `hcl:"timeout"`
	Owner     string  `hcl:"owner"`
	Repo      string  `hcl:"repo"`
}

type Match

type Match struct {
	Path       string      `hcl:"path,optional"`
	Kind       string      `hcl:"kind,optional"`
	Label      *MatchLabel `hcl:"label,block"`
	Annotation *MatchLabel `hcl:"annotation,block"`
}

type MatchLabel

type MatchLabel struct {
	Key   string `hcl:",label"`
	Value string `hcl:"value"`
	// contains filtered or unexported fields
}

type PrometheusConfig

type PrometheusConfig struct {
	Name    string   `hcl:",label"`
	URI     string   `hcl:"uri"`
	Timeout string   `hcl:"timeout"`
	Paths   []string `hcl:"paths,optional"`
}

type RateSettings

type RateSettings struct {
}

type RejectSettings

type RejectSettings struct {
	Regex            string `hcl:",label"`
	LabelKeys        bool   `hcl:"label_keys,optional"`
	LabelValues      bool   `hcl:"label_values,optional"`
	AnnotationKeys   bool   `hcl:"annotation_keys,optional"`
	AnnotationValues bool   `hcl:"annotation_values,optional"`
	Severity         string `hcl:"severity,optional"`
}

type Repository

type Repository struct {
	BitBucket *BitBucket `hcl:"bitbucket,block"`
	GitHub    *GitHub    `hcl:"github,block"`
}

type Rule

type Rule struct {
	Match          *Match                  `hcl:"match,block"`
	Aggregate      []AggregateSettings     `hcl:"aggregate,block"`
	Rate           *RateSettings           `hcl:"rate,block"`
	Annotation     []AnnotationSettings    `hcl:"annotation,block"`
	Label          []AnnotationSettings    `hcl:"label,block"`
	Series         *SeriesSettings         `hcl:"series,block"`
	Cost           *CostSettings           `hcl:"cost,block"`
	Alerts         *AlertsSettings         `hcl:"alerts,block"`
	Reject         []RejectSettings        `hcl:"reject,block"`
	Comparison     *ComparisonSettings     `hcl:"comparison,block"`
	Template       *TemplateSettings       `hcl:"template,block"`
	VectorMatching *VectorMatchingSettings `hcl:"vector_matching,block"`
}

type SeriesSettings

type SeriesSettings struct {
	Severity string `hcl:"severity,optional"`
}

type TemplateSettings

type TemplateSettings struct {
	Severity string `hcl:"severity,optional"`
}

type VectorMatchingSettings added in v0.1.3

type VectorMatchingSettings struct {
	Severity string `hcl:"severity,optional"`
}

Jump to

Keyboard shortcuts

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