Skip to content
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

Refactor client.OpenSergoClient with new model and refine code #16

Merged
merged 5 commits into from
Dec 3, 2022

Conversation

sczyh30
Copy link
Member

@sczyh30 sczyh30 commented Dec 1, 2022

Describe what this PR does / why we need it

Refactor client.OpenSergoClient with new model and refine code.

A sample of usage:

err := client.SubscribeConfig(subscribeKey, api.WithSubscriber(s1), api.WithSubscriber(s2))

Does this pull request fix one issue?

Resolves #14, #15

Describe how you did it

  • Rearrange SubscribeKey to model pkg and refine SubscriberRegistry
  • Add api.OpenSergoClient interface and functional SubscribeOptions
  • Refactor client.OpenSergoClient with the new model and improve error handling
  • Update samples

Describe how to verify it

Test cases TBD...

Special notes for reviews

NOTE: this PR contains breaking changes of API.

@sczyh30 sczyh30 added the kind/enhancement Category issues or PRs related to enhancement label Dec 1, 2022
@sczyh30 sczyh30 requested a review from jnan806 December 1, 2022 15:48
@sczyh30 sczyh30 linked an issue Dec 1, 2022 that may be closed by this pull request
@sczyh30 sczyh30 force-pushed the option-style-refactor branch from 685f6ed to ff3f26f Compare December 2, 2022 15:40
Copy link
Collaborator

@jnan806 jnan806 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jnan806 jnan806 merged commit f7928b3 into opensergo:main Dec 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Category issues or PRs related to enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve client SubscribeConfig API with option style Improve error handling in client.NewOpenSergoClient()
2 participants