大量的更新
This commit is contained in:
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user