diff options
| -rw-r--r-- | internal/config/config.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/internal/config/config.go b/internal/config/config.go index 5b9d468..9cc9eac 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -314,16 +314,19 @@ func (c *Config) validate() error { } switch monitor.Type { - case "http", "https", "tcp", "gemini", "icmp", "dns", "graphql": + case "http", "https", "tcp", "gemini", "icmp", "dns", "graphql", "database", "db": // Valid types default: - return fmt.Errorf("monitor %q has invalid type %q (must be http, https, tcp, gemini, icmp, dns, or graphql)", monitor.Name, monitor.Type) + return fmt.Errorf("monitor %q has invalid type %q (must be http, https, tcp, gemini, icmp, dns, graphql, or database)", 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) } + if (monitor.Type == "database" || monitor.Type == "db") && monitor.DBType == "" { + return fmt.Errorf("monitor %q is type 'database' but missing required 'db_type' field", monitor.Name) + } } } |