kubernetes

package
v3.5.0-rc.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 14, 2023 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

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) Close

func (cli *K8sDR) Close()

Close closes the K8sDR client.

func (*K8sDR) CloseConn

func (cli *K8sDR) CloseConn(conn *grpc.ClientConn)

CloseConn closes a given gRPC client connection.

func (*K8sDR) CreateRpcRootNodes

func (cli *K8sDR) CreateRpcRootNodes(serviceNames []string) error

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

func (cli *K8sDR) GetConfFromRegistry(key string) ([]byte, error)

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

func (cli *K8sDR) GetSelfConnTarget() string

GetSelfConnTarget returns the connection target of the client itself.

func (*K8sDR) Register

func (cli *K8sDR) Register(serviceName, host string, port int, opts ...grpc.DialOption) error

Register registers a service with Kubernetes.

func (*K8sDR) RegisterConf2Registry

func (cli *K8sDR) RegisterConf2Registry(key string, conf []byte) error

RegisterConf2Registry registers a configuration to the registry.

func (*K8sDR) UnRegister

func (cli *K8sDR) UnRegister() error

UnRegister removes a service registration from Kubernetes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL