Skip to content

Commit 5a1a016

Browse files
author
samshi
committed
feat: update base
1 parent 539d45c commit 5a1a016

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cluster/base/cluster.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77

88
// Cluster 集群管理器接口
99
type Cluster interface {
10-
// RegInstance 注册本地实例,实例name要保证集群内唯一
11-
RegInstance(ctx context.Context, name string) (Instance, error)
10+
// RegInstance 注册本地实例,实例id要保证集群内唯一
11+
RegInstance(ctx context.Context, id string) (Instance, error)
1212
// UnregInstance 注销本地实例
1313
UnregInstance(ctx context.Context) error
1414
// GetLocalInstance 获取本地实例

cluster/base/instance.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package base
33

44
// Instance 集群实例接口
55
type Instance interface {
6-
// GetName 获取实例名
7-
GetName() string
6+
// GetID 获取实例ID,该ID应该在集群内唯一
7+
GetID() string
88
// IsValid 是否是有效实例
99
IsValid() bool
1010
// IsSame() 是否是同一个实例

0 commit comments

Comments
 (0)