mirror of
				https://github.com/TeaOSLab/EdgeCommon.git
				synced 2025-11-04 05:00:24 +08:00 
			
		
		
		
	集群增加自动同步时钟选项
This commit is contained in:
		
							
								
								
									
										20
									
								
								pkg/nodeconfigs/clock_config.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								pkg/nodeconfigs/clock_config.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
			
		||||
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
 | 
			
		||||
 | 
			
		||||
package nodeconfigs
 | 
			
		||||
 | 
			
		||||
func DefaultClockConfig() *ClockConfig {
 | 
			
		||||
	return &ClockConfig{
 | 
			
		||||
		AutoSync: true,
 | 
			
		||||
		Server:   "",
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// ClockConfig 时钟相关配置
 | 
			
		||||
type ClockConfig struct {
 | 
			
		||||
	AutoSync bool   `yaml:"autoSync" json:"autoSync"` // 自动尝试同步时钟
 | 
			
		||||
	Server   string `yaml:"server" json:"server"`     // 时钟同步服务器
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (this *ClockConfig) Init() error {
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
@@ -63,8 +63,9 @@ type NodeConfig struct {
 | 
			
		||||
	TOA                  *TOAConfig                              `yaml:"toa" json:"toa"`
 | 
			
		||||
	SystemServices       map[string]maps.Map                     `yaml:"systemServices" json:"systemServices"` // 系统服务配置 type => params
 | 
			
		||||
	FirewallActions      []*firewallconfigs.FirewallActionConfig `yaml:"firewallActions" json:"firewallActions"`
 | 
			
		||||
	TimeZone             string                                  `yaml:"timeZone" json:"timeZone"`
 | 
			
		||||
	AutoOpenPorts        bool                                    `yaml:"autoOpenPorts" json:"autoOpenPorts"`
 | 
			
		||||
	TimeZone             string                                  `yaml:"timeZone" json:"timeZone"`           // 自动设置时区
 | 
			
		||||
	AutoOpenPorts        bool                                    `yaml:"autoOpenPorts" json:"autoOpenPorts"` // 自动开放所需端口
 | 
			
		||||
	Clock                *ClockConfig                            `yaml:"clock" json:"clock"`                 // 时钟配置
 | 
			
		||||
 | 
			
		||||
	// 指标
 | 
			
		||||
	MetricItems []*serverconfigs.MetricItemConfig `yaml:"metricItems" json:"metricItems"`
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user