mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-10 18:56:55 +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:
@@ -6,13 +6,14 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/yusing/godoxy/internal/proxmox"
|
||||
gperr "github.com/yusing/goutils/errs"
|
||||
)
|
||||
|
||||
type (
|
||||
IdlewatcherProviderConfig struct {
|
||||
Proxmox *ProxmoxConfig `json:"proxmox,omitempty"`
|
||||
Docker *DockerConfig `json:"docker,omitempty"`
|
||||
Proxmox *proxmox.NodeConfig `json:"proxmox,omitempty"`
|
||||
Docker *DockerConfig `json:"docker,omitempty"`
|
||||
} // @name IdlewatcherProviderConfig
|
||||
IdlewatcherConfigBase struct {
|
||||
// 0: no idle watcher.
|
||||
@@ -42,10 +43,6 @@ type (
|
||||
ContainerID string `json:"container_id" validate:"required"`
|
||||
ContainerName string `json:"container_name" validate:"required"`
|
||||
} // @name DockerConfig
|
||||
ProxmoxConfig struct {
|
||||
Node string `json:"node" validate:"required"`
|
||||
VMID int `json:"vmid" validate:"required"`
|
||||
} // @name ProxmoxConfig
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
Reference in New Issue
Block a user