replace all schema check with go-playground/validator/v10

This commit is contained in:
yusing
2024-12-18 04:48:29 +08:00
parent 00f60a6e78
commit 6aefe4d5d9
23 changed files with 149 additions and 250 deletions

View File

@@ -5,9 +5,9 @@ import (
)
type HealthCheckConfig struct {
Disable bool `json:"disable,omitempty" yaml:"disable" aliases:"disabled"`
Path string `json:"path,omitempty" yaml:"path"`
UseGet bool `json:"use_get,omitempty" yaml:"use_get"`
Interval time.Duration `json:"interval" yaml:"interval"`
Timeout time.Duration `json:"timeout" yaml:"timeout"`
Disable bool `json:"disable,omitempty" aliases:"disabled"`
Path string `json:"path,omitempty" validate:"omitempty,uri,startswith=/"`
UseGet bool `json:"use_get,omitempty"`
Interval time.Duration `json:"interval" validate:"omitempty,min=1s"`
Timeout time.Duration `json:"timeout" validate:"omitempty,min=1s"`
}