Documentation ¶
Index ¶
- func NewK8sDiscoveryRegister() (discoveryregistry.SvcDiscoveryRegistry, error)
- type K8sDR
- func (cli *K8sDR) AddOption(opts ...grpc.DialOption)
- func (cli *K8sDR) Close()
- func (cli *K8sDR) CloseConn(conn *grpc.ClientConn)
- func (cli *K8sDR) CreateRpcRootNodes(serviceNames []string) error
- func (cli *K8sDR) GetClientLocalConns() map[string][]*grpc.ClientConn
- func (cli *K8sDR) GetConfFromRegistry(key string) ([]byte, error)
- func (cli *K8sDR) GetConn(ctx context.Context, serviceName string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
- func (cli *K8sDR) GetConns(ctx context.Context, serviceName string, opts ...grpc.DialOption) ([]*grpc.ClientConn, error)
- func (cli *K8sDR) GetSelfConnTarget() string
- func (cli *K8sDR) Register(serviceName, host string, port int, opts ...grpc.DialOption) error
- func (cli *K8sDR) RegisterConf2Registry(key string, conf []byte) error
- func (cli *K8sDR) UnRegister() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewK8sDiscoveryRegister ¶
func NewK8sDiscoveryRegister() (discoveryregistry.SvcDiscoveryRegistry, error)
NewK8sDiscoveryRegister creates a new instance of K8sDR for Kubernetes service discovery and registration.
Types ¶
type K8sDR ¶
type K8sDR struct {
// contains filtered or unexported fields
}
K8sDR represents the Kubernetes service discovery and registration client.
func (*K8sDR) AddOption ¶
func (cli *K8sDR) AddOption(opts ...grpc.DialOption)
AddOption adds gRPC dial options to the client.
func (*K8sDR) CloseConn ¶
func (cli *K8sDR) CloseConn(conn *grpc.ClientConn)
CloseConn closes a given gRPC client connection.
func (*K8sDR) CreateRpcRootNodes ¶
CreateRpcRootNodes creates root nodes for RPC in Kubernetes.
func (*K8sDR) GetClientLocalConns ¶
func (cli *K8sDR) GetClientLocalConns() map[string][]*grpc.ClientConn
do not use this method for call rpc
func (*K8sDR) GetConfFromRegistry ¶
GetConfFromRegistry retrieves a configuration from the registry.
func (*K8sDR) GetConn ¶
func (cli *K8sDR) GetConn(ctx context.Context, serviceName string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
GetConn returns a single gRPC client connection for a given service.
func (*K8sDR) GetConns ¶
func (cli *K8sDR) GetConns(ctx context.Context, serviceName string, opts ...grpc.DialOption) ([]*grpc.ClientConn, error)
GetConns returns a list of gRPC client connections for a given service.
func (*K8sDR) GetSelfConnTarget ¶
GetSelfConnTarget returns the connection target of the client itself.
func (*K8sDR) RegisterConf2Registry ¶
RegisterConf2Registry registers a configuration to the registry.
func (*K8sDR) UnRegister ¶
UnRegister removes a service registration from Kubernetes.