server

package
v0.0.0-...-d18f1db Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MetricsLabels = []string{
	metricsMethodLabel,
	metricsPathLabel,
	metricsCodeLabel,
}

MetricsLabels - Array of labels added to metrics:

View Source
var MetricsNames = []string{
	requestCount,
	requestDuration,
}

MetricsNames - Array of Names of the metrics:

View Source
var PathVarSub = "-"

PathVarSub replaces path variables to a same character

Functions

func MetricsMiddleware

func MetricsMiddleware(handler http.Handler) http.Handler

MetricsMiddleware creates a new handler that collects metrics for the requests processed by the given handler.

func NewHealthCheckServer

func NewHealthCheckServer() *healthCheckServer

func ResetMetricCollectors

func ResetMetricCollectors()

ResetMetricCollectors resets all prometheus collectors

Types

type ControllersServer

type ControllersServer struct {
	KindControllerManager *controllers.KindControllerManager
	DB                    db.SessionFactory
}

func NewControllersServer

func NewControllersServer() *ControllersServer

func (ControllersServer) Start

func (s ControllersServer) Start(ctx context.Context)

Start is a blocking call that starts this controller server

type GRPCServer

type GRPCServer struct {
	pbv1.UnimplementedCloudEventServiceServer
	// contains filtered or unexported fields
}

GRPCServer includes a gRPC server and a resource service

func NewGRPCServer

func NewGRPCServer(resourceService services.ResourceService, eventBroadcaster *event.EventBroadcaster, config config.GRPCServerConfig) *GRPCServer

NewGRPCServer creates a new GRPCServer

func (*GRPCServer) Publish

func (svr *GRPCServer) Publish(ctx context.Context, pubReq *pbv1.PublishRequest) (*emptypb.Empty, error)

Publish implements the Publish method of the CloudEventServiceServer interface

func (*GRPCServer) Start

func (svr *GRPCServer) Start() error

Start starts the gRPC server

func (*GRPCServer) Stop

func (svr *GRPCServer) Stop()

Stop stops the gRPC server

func (*GRPCServer) Subscribe

Subscribe implements the Subscribe method of the CloudEventServiceServer interface

type PulseServer

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

PulseServer represents a server responsible for periodic heartbeat updates and checking the liveness of Maestro instances, triggering status resync based on instances' status and other conditions.

func NewPulseServer

func NewPulseServer(eventBroadcaster *event.EventBroadcaster) *PulseServer

func (*PulseServer) Start

func (s *PulseServer) Start(ctx context.Context)

Start initializes and runs the pulse server, updating and checking Maestro instances' liveness, initializes subscription to status update messages and triggers status resync based on instances' status and other conditions.

type Server

type Server interface {
	Start()
	Stop() error
	Listen() (net.Listener, error)
	Serve(net.Listener)
}

func NewAPIServer

func NewAPIServer(eventBroadcaster *event.EventBroadcaster) Server

func NewMetricsServer

func NewMetricsServer() Server

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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