mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-18 22:49:52 +02:00
feat: idle sleep for proxmox LXCs
This commit is contained in:
@@ -14,7 +14,7 @@ import (
|
||||
"github.com/yusing/go-proxy/internal/gperr"
|
||||
"github.com/yusing/go-proxy/internal/net/gphttp/accesslog"
|
||||
"github.com/yusing/go-proxy/internal/notif"
|
||||
proxmox "github.com/yusing/go-proxy/internal/proxmox/types"
|
||||
"github.com/yusing/go-proxy/internal/proxmox"
|
||||
"github.com/yusing/go-proxy/internal/utils"
|
||||
)
|
||||
|
||||
@@ -28,11 +28,11 @@ type (
|
||||
TimeoutShutdown int `json:"timeout_shutdown" validate:"gte=0"`
|
||||
}
|
||||
Providers struct {
|
||||
Files []string `json:"include" yaml:"include,omitempty" validate:"unique,dive,config_file_exists"`
|
||||
Docker map[string]string `json:"docker" yaml:"docker,omitempty" validate:"unique,dive,unix_addr|url"`
|
||||
Proxmox map[string]proxmox.Config `json:"proxmox" yaml:"proxmox,omitempty"`
|
||||
Agents []*agent.AgentConfig `json:"agents" yaml:"agents,omitempty" validate:"unique=Addr"`
|
||||
Notification []notif.NotificationConfig `json:"notification" yaml:"notification,omitempty" validate:"unique=ProviderName"`
|
||||
Files []string `json:"include" validate:"unique,dive,config_file_exists"`
|
||||
Docker map[string]string `json:"docker" validate:"unique,dive,unix_addr|url"`
|
||||
Proxmox []proxmox.Config `json:"proxmox"`
|
||||
Agents []*agent.AgentConfig `json:"agents" validate:"unique=Addr"`
|
||||
Notification []notif.NotificationConfig `json:"notification" validate:"unique=ProviderName"`
|
||||
}
|
||||
Entrypoint struct {
|
||||
Middlewares []map[string]any `json:"middlewares"`
|
||||
@@ -102,7 +102,7 @@ func init() {
|
||||
})
|
||||
utils.MustRegisterValidation("config_file_exists", func(fl validator.FieldLevel) bool {
|
||||
filename := fl.Field().Interface().(string)
|
||||
info, err := os.Stat(path.Join(common.ConfigBasePath, filename))
|
||||
info, err := os.Stat(path.Join(common.ConfigDir, filename))
|
||||
return err == nil && !info.IsDir()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user