大量的更新

This commit is contained in:
zeaslity
2025-02-26 17:44:03 +08:00
parent b8170e00d4
commit c751c21871
8 changed files with 323 additions and 42 deletions

View File

@@ -3,9 +3,11 @@ package config
import (
"agent-wdd/log"
"agent-wdd/utils"
"os"
"runtime"
"github.com/spf13/viper"
"gopkg.in/yaml.v3"
"os"
)
var WddConfigFilePath = "/usr/local/etc/wdd/agent-wdd-config.yaml"
@@ -14,9 +16,12 @@ var ConfigCache *Config
func init() {
// 根据运行的操作系统不同, 修改 WddConfigFilePath 的位置
if runtime.GOOS == "windows" {
homedir, _ := os.UserHomeDir()
WddConfigFilePath = homedir + "\\agent-wdd\\agent-wdd-config.yaml"
}
}
// 配置结构体定义
type Config struct {
TimeStamp string `yaml:"timestamp"`
ModifiedTimes int `yaml:"modifiedTimes"`