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
June 12, 2025
: chore: rm duplicated imgs & resize big images (#1347) (799b816)