-
Notifications
You must be signed in to change notification settings - Fork 14
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
Initial version of OpenSergo Go SDK #2
Conversation
914c1c4
to
6accd10
Compare
Could you please reformat your code with goimports? |
552930e
to
17af49b
Compare
fixed ! thanks for your review ~ |
4027c1a
to
c312329
Compare
b4da979
to
fa863b7
Compare
是否可以对项目结构的设计原则做一下说明? 项目结构:
对于可暴露的代码,建议取消pkg,直接暴露出来,比如 |
|
As discussed and debugged with @jnan806, these weird race conditions were mainly caused by non-thread-safe access of How to reproduce it: when a client has established a connection to the control plane, we restart the control plane; in the meantime we initiate Subscribe or Unsubscribe command concurrently. |
Signed-off-by: Jiangnan Jia <jnan0806@gmail.com>
Signed-off-by: Jiangnan Jia <jnan0806@gmail.com>
601764a
to
88c3aa7
Compare
Yeah, and has resolve concurrent-safety with several |
ff9df94
to
17244d1
Compare
14e01c7
to
7ba160a
Compare
Signed-off-by: Jiangnan Jia <jnan0806@gmail.com>
Signed-off-by: Jiangnan Jia <jnan0806@gmail.com>
52edf9f
to
46b9d34
Compare
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.
LGTM
Nice work. Since this is a large PR containing the initial implementation of the SDK, I'll create a merge commit for this PR. |
Fabulous! Thanks for contributing! PS: We may improve the SDK implementation later :) |
It's my pleasure ~ And I will keep following and improving it. 😃 |
初版 opensergo-go-sdk, 可配合 opensergo-control-plane 进行联调.
联调步骤:
详细可参考 README.md 或 main.go
OpenSergo Go SDK
How to use
scene 1 : subscribe config-data
scene 2 : subscribe config-data with custom-logic when config-data changed.
Add a subscriber by implements the function in
subscribe.Subscriber
.There are some samples in
sample
directory :sample/main/sample_faulttolerance_rule_subscriber.go
andsample_ratelimit_strategy_subscriber.go
And then register it to
subscriber.SubscriberRegistry
.Demo-code is in
sample/main
directory