mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-03 23:20:26 +08:00
DNS节点可以自动升级
This commit is contained in:
@@ -65,7 +65,7 @@ func (this *DeployManager) FindNodeFile(os string, arch string) *DeployFile {
|
||||
return nil
|
||||
}
|
||||
|
||||
// LoadNSNodeFiles 加载所有文件
|
||||
// LoadNSNodeFiles 加载所有NS节点安装文件
|
||||
func (this *DeployManager) LoadNSNodeFiles() []*DeployFile {
|
||||
keyMap := map[string]*DeployFile{} // key => File
|
||||
|
||||
@@ -99,3 +99,13 @@ func (this *DeployManager) LoadNSNodeFiles() []*DeployFile {
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
// FindNSNodeFile 查找特别平台的NS节点安装文件
|
||||
func (this *DeployManager) FindNSNodeFile(os string, arch string) *DeployFile {
|
||||
for _, file := range this.LoadNSNodeFiles() {
|
||||
if file.OS == os && file.Arch == arch {
|
||||
return file
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -16,3 +16,9 @@ func TestDeployManager_LoadNSNodeFiles(t *testing.T) {
|
||||
t.Logf("%#v", file)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDeployManager_FindNSNodeFile(t *testing.T) {
|
||||
file := NewDeployManager().FindNSNodeFile("linux", "amd64")
|
||||
t.Log(file)
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user