enhance: validate settings value before save

This commit is contained in:
0xJacky 2024-01-27 23:01:07 +08:00
parent d70e37c857
commit d67b8428e4
No known key found for this signature in database
GPG key ID: B6E4A6E4A561BAF0
8 changed files with 83 additions and 26 deletions

View file

@ -1,8 +1,8 @@
package settings
type Nginx struct {
AccessLogPath string `json:"access_log_path"`
ErrorLogPath string `json:"error_log_path"`
AccessLogPath string `json:"access_log_path" binding:"omitempty,file"`
ErrorLogPath string `json:"error_log_path" binding:"omitempty,file"`
ConfigDir string `json:"config_dir" protected:"true"`
PIDPath string `json:"pid_path" protected:"true"`
TestConfigCmd string `json:"test_config_cmd" protected:"true"`