kubernetes

package
v0.0.50-alpha.22 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type K8sConnManager

type K8sConnManager struct {
	// contains filtered or unexported fields
}

func NewK8sConnManager

func NewK8sConnManager(namespace string, options ...grpc.DialOption) (*K8sConnManager, error)

NewK8sConnManager creates a new connection manager that uses Kubernetes services for service discovery

func (*K8sConnManager) AddOption

func (k *K8sConnManager) AddOption(opts ...grpc.DialOption)

AddOption appends gRPC dial options to the existing options

func (*K8sConnManager) Close

func (k *K8sConnManager) Close()

Close closes all gRPC connections managed by K8sConnManager

func (*K8sConnManager) CloseConn

func (k *K8sConnManager) CloseConn(conn *grpc.ClientConn)

CloseConn closes a given gRPC client connection

func (*K8sConnManager) GetConn

func (k *K8sConnManager) GetConn(ctx context.Context, serviceName string, opts ...grpc.DialOption) (*grpc.ClientConn, error)

GetConn returns a single gRPC client connection for a given Kubernetes service name

func (*K8sConnManager) GetConns

func (k *K8sConnManager) GetConns(ctx context.Context, serviceName string, opts ...grpc.DialOption) ([]*grpc.ClientConn, error)

GetConns returns gRPC client connections for a given Kubernetes service name

func (*K8sConnManager) GetSelfConnTarget

func (k *K8sConnManager) GetSelfConnTarget() string

GetSelfConnTarget returns the connection target for the current service

func (*K8sConnManager) GetUserIdHashGatewayHost

func (k *K8sConnManager) GetUserIdHashGatewayHost(ctx context.Context, userId string) (string, error)

func (*K8sConnManager) Register

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

func (*K8sConnManager) UnRegister

func (k *K8sConnManager) UnRegister() error

Jump to

Keyboard shortcuts

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