cloudflare/pint

Public

mirrored from https://github.com/cloudflare/pintAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v0.29.2

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

internal/config/alerts.go

26lines · modecode

1package config
2
3type AlertsSettings struct {
4 Range string `hcl:"range" json:"range"`
5 Step string `hcl:"step" json:"step"`
6 Resolve string `hcl:"resolve" json:"resolve"`
7}
8
9func (as AlertsSettings) validate() error {
10 if as.Range != "" {
11 if _, err := parseDuration(as.Range); err != nil {
12 return err
13 }
14 }
15 if as.Step != "" {
16 if _, err := parseDuration(as.Step); err != nil {
17 return err
18 }
19 }
20 if as.Resolve != "" {
21 if _, err := parseDuration(as.Resolve); err != nil {
22 return err
23 }
24 }
25 return nil
26}
27