Documentation
¶
Overview ¶
SPDX-License-Identifier: MIT SPDX-FileCopyrightText: 2023 werbenhu SPDX-FileContributor: werbenhu
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RpcClient ¶
type RpcClient struct {
// Addr is the registry server address.
Addr string
// contains filtered or unexported fields
}
RpcClient is a gRPC client for service discovery.
func NewRpcClient ¶
NewRpcClient creates a new RpcClient object and connects to the registry server at `addr`.
func (*RpcClient) Match ¶
Match assigns a service to a key using the consistent hashing algorithm.
Parameters: - group: The group name of the services. - key: The key, such as user ID, device ID, etc.
Returns: - The service that matches the key. - An error if the service cannot be found.
Click to show internal directories.
Click to hide internal directories.