Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(‎contrib/registry/nacos): add SetDefaultEndpoint and SetDefaultMetadata methods#4608

Merged
hailaz merged 3 commits intogogf:masterfrom
wangle201210:feat/nacos
Jan 15, 2026
Merged

feat(‎contrib/registry/nacos): add SetDefaultEndpoint and SetDefaultMetadata methods#4608
hailaz merged 3 commits intogogf:masterfrom
wangle201210:feat/nacos

Conversation

@wangle201210
Copy link
Member

Add configurable default endpoint and metadata support to nacos Registry,
providing a more flexible alternative to hardcoded environment variable reads.

  • Add defaultEndpoint and defaultMetadata fields to Registry struct
  • Add SetDefaultEndpoint method to override service endpoints
  • Add SetDefaultMetadata method to merge extra metadata
  • Update Register method to use configured defaults

Copilot AI review requested due to automatic review settings January 15, 2026 02:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds configurable default endpoint and metadata support to the Nacos registry, allowing developers to programmatically override service endpoints and merge additional metadata during registration instead of relying solely on environment variables.

Changes:

  • Add defaultEndpoint and defaultMetadata fields to Registry struct
  • Add SetDefaultEndpoint and SetDefaultMetadata methods for configuration
  • Update Register method to apply configured defaults during service registration

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
contrib/registry/nacos/nacos.go Adds struct fields and setter methods for default endpoint and metadata configuration
contrib/registry/nacos/nacos_register.go Updates Register method to apply default endpoint override and merge default metadata

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hailaz hailaz changed the title feat(nacos): add SetDefaultEndpoint and SetDefaultMetadata methods feat(‎contrib/registry/nacos): add SetDefaultEndpoint and SetDefaultMetadata methods Jan 15, 2026
@hailaz hailaz merged commit 6219da7 into gogf:master Jan 15, 2026
18 checks passed
@hailaz
Copy link
Contributor

hailaz commented Jan 15, 2026

fixed #4609

lingcoder added a commit to lingcoder/gf that referenced this pull request Jan 23, 2026
…methods

- Remove defaultEndpoint and defaultMetadata fields that cause data race
  when SetDefaultMetadata/SetDefaultEndpoint and Register are called concurrently
- Remove SetDefaultEndpoint and SetDefaultMetadata methods (introduced in PR gogf#4608)
- Mark SetClusterName and SetGroupName as deprecated with warning about
  concurrency safety and future removal

Closes gogf#4649
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants