-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Implement the logic of the NACOS service in the Discovery module #604
Conversation
pkg/discovery/nacos.go
Outdated
return &NacosRegistryService{client, nacosConfig} | ||
} | ||
|
||
func ParseNacosServerConfig(config NacosConfig) ([]constant.ServerConfig, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议改为小写非导出的内部函数
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #604 +/- ##
==========================================
+ Coverage 37.28% 37.41% +0.12%
==========================================
Files 175 175
Lines 11666 11712 +46
==========================================
+ Hits 4350 4382 +32
- Misses 6952 6964 +12
- Partials 364 366 +2
☔ View full report in Codecov by Sentry. |
"github.com/seata/seata-go/pkg/util/log" | ||
) | ||
|
||
type NacosRegistryService struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以在nacos.go内部维护一份缓存,并监听nacos server的节点变化,更新本地缓存。
pkg/discovery/nacos_test.go
Outdated
"github.com/nacos-group/nacos-sdk-go/v2/model" | ||
"github.com/seata/seata-go/pkg/discovery/mock" | ||
"github.com/stretchr/testify/assert" | ||
"reflect" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
format
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
pkg/discovery/nacos.go
Outdated
ServiceName: s.nacosServerConfig.Application, | ||
}) | ||
if err != nil { | ||
log.Fatalf("select all nacos service instance error") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems don't need Fatalf
level
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
please review my newest updated codes again that are changes in response to some review comments. below are details of what are commit work for : in this commit i change the log level in this commit i format codes as expect Below comments are no comments match The main purpose of this commit is to resolve the merge conflict. The main purpose of this commit is to fix for missing update If there is anything that I have done wrong, please do not hesitate to provide guidance. Thx :) |
What this PR does:
#577
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: