Skip to content

Commit b962ba3

Browse files
committed
将GetInstanceHost改为GetInstanceIP,遵循基于实例操作的原则
1 parent e5d90b1 commit b962ba3

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

docs/deploy/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ func ValidatePackageURL(packageURL string) error
131131
func GetServiceInstanceIDs(serviceName string, version ...string) ([]string, error)
132132
```
133133

134-
### 5.3 **GetInstanceHost**: 根据实例ID获取实例的IP地址
134+
### 5.3 **GetInstanceIP**: 根据实例ID获取实例的IP地址
135135
```go
136-
func GetInstanceHost(instanceID string) (string, error)
136+
func GetInstanceIP(instanceID string) (string, error)
137137
```
138138

139139
### 5.4 **GetInstancePort**: 根据实例ID获取实例的端口号

docs/deploy/interface.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,13 @@ version ...string // 选填,指定版本号进行过滤,未输入则默
204204

205205
**返回结果**: `[]string` - 实例ID数组
206206

207-
### 4.3 GetInstanceHost函数
207+
### 4.3 GetInstanceIP函数
208208

209209
**函数描述**: 根据实例ID获取实例的IP地址
210210

211211
**函数签名**:
212212
```go
213-
func GetInstanceHost(instanceID string) (string, error)
213+
func GetInstanceIP(instanceID string) (string, error)
214214
```
215215

216216
**输入参数**:

internal/deploy/service/deploy_service.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ func (f *floyDeployService) DeployNewVersion(params *model.DeployNewVersionParam
233233
}
234234

235235
// 5.2 获取实例IP
236-
instanceIP, err := GetInstanceHost(instanceID)
236+
instanceIP, err := GetInstanceIP(instanceID)
237237
if err != nil {
238238
// 记录错误但继续处理其他实例
239239
fmt.Printf("获取实例 %s 的IP失败: %v\n", instanceID, err)
@@ -302,7 +302,7 @@ func (f *floyDeployService) ExecuteRollback(params *model.RollbackParams) (*mode
302302
}
303303

304304
// 5.2 获取实例IP
305-
instanceIP, err := GetInstanceHost(instanceID)
305+
instanceIP, err := GetInstanceIP(instanceID)
306306
if err != nil {
307307
// 记录错误但继续处理其他实例
308308
fmt.Printf("获取实例 %s 的IP失败: %v\n", instanceID, err)

internal/deploy/service/internal_utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func GetServiceInstanceIDs(serviceName string, version ...string) ([]string, err
1313
}
1414

1515
// GetInstanceHost 根据实例ID获取实例的IP地址
16-
func GetInstanceHost(instanceID string) (string, error) {
16+
func GetInstanceIP(instanceID string) (string, error) {
1717
// TODO: 实现获取实例IP地址逻辑
1818
return "", nil
1919
}

0 commit comments

Comments
 (0)