mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-19 06:59:50 +02:00
refactor(proxmox): consolidate NodeConfig and add service field
Centralize Proxmox node configuration by moving `ProxmoxConfig` from `internal/types/idlewatcher.go` to a new `NodeConfig` struct in `internal/proxmox/node.go`. - Add `proxmox` field to route; allowing `proxy.app.proxmox` labels and corresponding route file config - Added `service` optional field to NodeConfig for service identification - Integrated Proxmox config directly into Route struct with proper validation - Propagate Proxmox settings to Idlewatcher during route validation - Updated swagger documentation to reflect schema changes
This commit is contained in:
@@ -64,6 +64,8 @@ type (
|
||||
AccessLog *accesslog.RequestLoggerConfig `json:"access_log,omitempty" extensions:"x-nullable"`
|
||||
Agent string `json:"agent,omitempty"`
|
||||
|
||||
Proxmox *proxmox.NodeConfig `json:"proxmox,omitempty" extensions:"x-nullable"`
|
||||
|
||||
Idlewatcher *types.IdlewatcherConfig `json:"idlewatcher,omitempty" extensions:"x-nullable"`
|
||||
|
||||
Metadata `deserialize:"-"`
|
||||
@@ -176,6 +178,10 @@ func (r *Route) validate() gperr.Error {
|
||||
}
|
||||
}, r.started)
|
||||
|
||||
if r.Proxmox != nil && r.Idlewatcher != nil {
|
||||
r.Idlewatcher.Proxmox = r.Proxmox
|
||||
}
|
||||
|
||||
if r.Idlewatcher != nil && r.Idlewatcher.Proxmox != nil {
|
||||
node := r.Idlewatcher.Proxmox.Node
|
||||
vmid := r.Idlewatcher.Proxmox.VMID
|
||||
|
||||
Reference in New Issue
Block a user