修改集群模式使用封装的方法
This commit is contained in:
+10
-3
@@ -8,10 +8,11 @@ import (
|
||||
)
|
||||
|
||||
type Options struct {
|
||||
logger logger.Logger
|
||||
instanceId string
|
||||
logger logger.Logger // 日志
|
||||
instanceId string // 实例ID
|
||||
priority *priority.Priority // 全局优先级
|
||||
leader *leader.Leader
|
||||
leader *leader.Leader // Leader
|
||||
source string // 来源服务
|
||||
}
|
||||
|
||||
func defaultOptions() Options {
|
||||
@@ -57,3 +58,9 @@ func WithInstanceId(instanceId string) Option {
|
||||
o.instanceId = instanceId
|
||||
}
|
||||
}
|
||||
|
||||
func WithSource(source string) Option {
|
||||
return func(o *Options) {
|
||||
o.source = source
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user