mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-20 16:01:36 +02:00
replace all schema check with go-playground/validator/v10
This commit is contained in:
@@ -2,13 +2,13 @@ package types
|
||||
|
||||
type (
|
||||
AutoCertConfig struct {
|
||||
Email string `json:"email,omitempty" yaml:"email"`
|
||||
Domains []string `json:"domains,omitempty" yaml:",flow"`
|
||||
CertPath string `json:"cert_path,omitempty" yaml:"cert_path"`
|
||||
KeyPath string `json:"key_path,omitempty" yaml:"key_path"`
|
||||
ACMEKeyPath string `json:"acme_key_path,omitempty" yaml:"acme_key_path"`
|
||||
Provider string `json:"provider,omitempty" yaml:"provider"`
|
||||
Options AutocertProviderOpt `json:"options,omitempty" yaml:",flow"`
|
||||
Email string `json:"email,omitempty" validate:"email"`
|
||||
Domains []string `json:"domains,omitempty"`
|
||||
CertPath string `json:"cert_path,omitempty" validate:"omitempty,filepath"`
|
||||
KeyPath string `json:"key_path,omitempty" validate:"omitempty,filepath"`
|
||||
ACMEKeyPath string `json:"acme_key_path,omitempty" validate:"omitempty,filepath"`
|
||||
Provider string `json:"provider,omitempty"`
|
||||
Options AutocertProviderOpt `json:"options,omitempty"`
|
||||
}
|
||||
AutocertProviderOpt map[string]any
|
||||
)
|
||||
|
||||
@@ -4,21 +4,21 @@ import "github.com/yusing/go-proxy/internal/net/http/accesslog"
|
||||
|
||||
type (
|
||||
Config struct {
|
||||
AutoCert AutoCertConfig `json:"autocert" yaml:",flow"`
|
||||
Entrypoint Entrypoint `json:"entrypoint" yaml:",flow"`
|
||||
Providers Providers `json:"providers" yaml:",flow"`
|
||||
MatchDomains []string `json:"match_domains" yaml:"match_domains"`
|
||||
Homepage HomepageConfig `json:"homepage" yaml:"homepage"`
|
||||
TimeoutShutdown int `json:"timeout_shutdown" yaml:"timeout_shutdown"`
|
||||
AutoCert *AutoCertConfig `json:"autocert"`
|
||||
Entrypoint Entrypoint `json:"entrypoint"`
|
||||
Providers Providers `json:"providers"`
|
||||
MatchDomains []string `json:"match_domains" validate:"dive,fqdn"`
|
||||
Homepage HomepageConfig `json:"homepage"`
|
||||
TimeoutShutdown int `json:"timeout_shutdown" validate:"gte=0"`
|
||||
}
|
||||
Providers struct {
|
||||
Files []string `json:"include" yaml:"include"`
|
||||
Docker map[string]string `json:"docker" yaml:"docker"`
|
||||
Notification []NotificationConfig `json:"notification" yaml:"notification"`
|
||||
Files []string `json:"include" validate:"dive,filepath"`
|
||||
Docker map[string]string `json:"docker" validate:"dive,unix_addr|url"`
|
||||
Notification []NotificationConfig `json:"notification"`
|
||||
}
|
||||
Entrypoint struct {
|
||||
Middlewares []map[string]any `json:"middlewares" yaml:"middlewares"`
|
||||
AccessLog *accesslog.Config `json:"access_log" yaml:"access_log"`
|
||||
Middlewares []map[string]any `json:"middlewares"`
|
||||
AccessLog *accesslog.Config `json:"access_log"`
|
||||
}
|
||||
NotificationConfig map[string]any
|
||||
)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package types
|
||||
|
||||
type HomepageConfig struct {
|
||||
UseDefaultCategories bool `json:"use_default_categories" yaml:"use_default_categories"`
|
||||
UseDefaultCategories bool `json:"use_default_categories"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user