diff options
Diffstat (limited to 'internal/config/config.go')
| -rw-r--r-- | internal/config/config.go | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/internal/config/config.go b/internal/config/config.go index 7ed28dd..71a9b99 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -93,6 +93,16 @@ type MonitorConfig struct { UserAgent string `yaml:"user_agent,omitempty"` // Custom User-Agent header (default: "Kaze-Monitor/1.0") Headers map[string]string `yaml:"headers,omitempty"` Body string `yaml:"body,omitempty"` + // ICMP specific fields + PingCount int `yaml:"ping_count,omitempty"` // Number of ICMP packets to send (default: 4) + // DNS specific fields + DNSServer string `yaml:"dns_server,omitempty"` // DNS server to query (default: system resolver) + ExpectedIPs []string `yaml:"expected_ips,omitempty"` // Expected IP addresses for DNS resolution + ExpectedCNAME string `yaml:"expected_cname,omitempty"` // Expected CNAME record + RecordType string `yaml:"record_type,omitempty"` // DNS record type (A, AAAA, CNAME, MX, TXT, etc.) + // GraphQL specific fields + GraphQLQuery string `yaml:"graphql_query,omitempty"` // GraphQL query to execute + GraphQLVariables map[string]string `yaml:"graphql_variables,omitempty"` // GraphQL query variables } // IncidentConfig represents an incident or maintenance @@ -300,10 +310,15 @@ func (c *Config) validate() error { } switch monitor.Type { - case "http", "https", "tcp", "gemini": + case "http", "https", "tcp", "gemini", "icmp", "dns", "graphql": // Valid types default: - return fmt.Errorf("monitor %q has invalid type %q (must be http, https, tcp, or gemini)", monitor.Name, monitor.Type) + return fmt.Errorf("monitor %q has invalid type %q (must be http, https, tcp, gemini, icmp, dns, or graphql)", monitor.Name, monitor.Type) + } + + // Type-specific validation + if monitor.Type == "graphql" && monitor.GraphQLQuery == "" { + return fmt.Errorf("monitor %q is type 'graphql' but missing required 'graphql_query' field", monitor.Name) } } } |