fix(config): update JSON tags in ACL and access log configurations to omit empty values

Modified JSON tags in the Notify struct of ACL config and the ConfigBase and Retention structs in access log config to include 'omitempty'
This commit is contained in:
yusing
2026-01-22 00:18:58 +08:00
parent 29036bed18
commit 25605208e4
3 changed files with 7 additions and 7 deletions

View File

@@ -26,9 +26,9 @@ type Config struct {
Log *accesslog.ACLLoggerConfig `json:"log"`
Notify struct {
To []string `json:"to"` // list of notification providers
Interval time.Duration `json:"interval"` // interval between notifications
IncludeAllowed *bool `json:"include_allowed"` // default: false
To []string `json:"to,omitempty"` // list of notification providers
Interval time.Duration `json:"interval,omitempty"` // interval between notifications
IncludeAllowed *bool `json:"include_allowed,omitzero"` // default: false
} `json:"notify"`
config

View File

@@ -10,7 +10,7 @@ import (
type (
ConfigBase struct {
Path string `json:"path"`
Path string `json:"path,omitempty"`
Stdout bool `json:"stdout"`
Retention *Retention `json:"retention" aliases:"keep"`
RotateInterval time.Duration `json:"rotate_interval,omitempty" swaggertype:"primitive,integer"`

View File

@@ -9,9 +9,9 @@ import (
)
type Retention struct {
Days uint64 `json:"days"`
Last uint64 `json:"last"`
KeepSize uint64 `json:"keep_size"`
Days uint64 `json:"days,omitempty"`
Last uint64 `json:"last,omitempty"`
KeepSize uint64 `json:"keep_size,omitempty"`
} // @name LogRetention
var (