polaris
Service Registration and Discovery polaris Extensions provided by Hertz.
Install
Service Registry
NewPolarisRegistry
NewPolarisRegistry
creates a new service registry using polaris, passing in a configuration file and calling GetPolarisConfig
, using the default configuration if not passed in.
Function signature:
Example:
Service Discovery
NewPolarisResolver
NewPolarisResolver
uses polaris to create a new service discovery center, passing in a configuration file and calling GetPolarisConfig
, using the default configuration if not passed in.
Function signature:
Example:
How to use
Server
Client
Configuration
The configuration of Polaris client and server can be customized, refer to the configuration of polaris-go.
Complete Example
For more, see example .
Last modified
January 13, 2025
: Update release-v0_12_0.md (#1203) (72c8d84)