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"` Log *accesslog.ACLLoggerConfig `json:"log"`
Notify struct { Notify struct {
To []string `json:"to"` // list of notification providers To []string `json:"to,omitempty"` // list of notification providers
Interval time.Duration `json:"interval"` // interval between notifications Interval time.Duration `json:"interval,omitempty"` // interval between notifications
IncludeAllowed *bool `json:"include_allowed"` // default: false IncludeAllowed *bool `json:"include_allowed,omitzero"` // default: false
} `json:"notify"` } `json:"notify"`
config config

View File

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

View File

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