server

package
v1.15.4 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Description: This file has the package server.

Description: This file has the package server.

Description: This file has the package server.

Description: This file has the package server.

Description: This file has the package server.

Description: This file has the package server.

Package server has helpers for creating gRPC server

Description: This file has the package server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exposer

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

func NewExposer

func NewExposer(parentCtx context.Context, k kubernetes.Interface, kconf *rest.Config, log logrus.FieldLogger) (*Exposer, error)

NewExposer creates a service that can maintain multiple expose instances

func (*Exposer) Close

func (e *Exposer) Close(namespace, serviceName string) error

func (*Exposer) Start

func (e *Exposer) Start(ports []kube.ResolvedServicePort, namespace, serviceName string) error

func (*Exposer) Wait

func (e *Exposer) Wait()

Wait waits for all exposes to be shut down

type GRPCService

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

func NewGRPCService

func NewGRPCService(opts *RunOpts) *GRPCService

func (*GRPCService) CleanupPreviousInstance

func (g *GRPCService) CleanupPreviousInstance(ctx context.Context, log logrus.FieldLogger) error

CleanupPreviousInstance attempts to cleanup after a dead localizer instance if a not dead one is found, an error is returned or if it fails to cleanup

func (*GRPCService) Run

Run starts a grpc server with the internal server handler

type GRPCServiceHandler

type GRPCServiceHandler struct {
	api.UnimplementedLocalizerServiceServer
	// contains filtered or unexported fields
}

func NewServiceHandler

func NewServiceHandler(ctx context.Context, log logrus.FieldLogger, opts *RunOpts) (*GRPCServiceHandler, error)

func (*GRPCServiceHandler) ExposeService

func (*GRPCServiceHandler) Kill added in v1.12.0

Kill implements the Kill RPC for the localizer gRPC server.

This RPC just kills the current localizer process. Note that it actually waits until after the RPC returns (responds) before killing the process because if it kills it before it attempts to respond, the transport will have been closed already, resulting in a perceived error. Because of this stipulation, this RPC is only BEST EFFORT.

func (*GRPCServiceHandler) List

func (*GRPCServiceHandler) Ping

func (*GRPCServiceHandler) Stable added in v1.12.0

Stable implements the Stable RPC for the localizer gRPC server.

func (*GRPCServiceHandler) StopExpose

type RunOpts

type RunOpts struct {
	ClusterDomain string
	IPCidr        string
	KubeContext   string

	// SkipNamespaces is a list of namespaces to skip when forwarding
	// services. Defaults to "kube-system" when passed to NewGRPCService.
	SkipNamespaces []string
}

Jump to

Keyboard shortcuts

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