server

package
v0.0.0-...-8540621 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateGRPCServer

func CreateGRPCServer(env env.Env, serverOpts *GRPCServerOptions) *grpc.Server

CreateGRPCServer creates a GRPC server with default middleware for our services.

Types

type GRPCServerOptions

type GRPCServerOptions struct {
	DisableAuth       map[string]bool
	AuthMiddleware    func(context.Context, env.Env) (string, error) // Currently only used by cloud api-server.
	GRPCServerOpts    []grpc.ServerOption
	DisableMiddleware bool
}

GRPCServerOptions are configuration options that are passed to the GRPC server.

type PLServer

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

PLServer is the services server component used across all Pixie Labs services. It starts both an HTTP and a GRPC server and handles middelware and env injection.

func NewPLServer

func NewPLServer(env env.Env, httpHandler http.Handler, grpcServerOpts ...grpc.ServerOption) *PLServer

NewPLServer creates a new PLServer.

func NewPLServerWithOptions

func NewPLServerWithOptions(env env.Env, httpHandler http.Handler, opts *GRPCServerOptions) *PLServer

NewPLServerWithOptions creates a new PLServer.

func (*PLServer) GRPCServer

func (s *PLServer) GRPCServer() *grpc.Server

GRPCServer returns a pointer to the underlying GRPC server.

func (*PLServer) Start

func (s *PLServer) Start()

Start runs the services in go routines. It returns immediately. On error in starting services the program will terminate.

func (*PLServer) Stop

func (s *PLServer) Stop()

Stop will gracefully shutdown underlying GRPC and HTTP servers.

func (*PLServer) StopOnInterrupt

func (s *PLServer) StopOnInterrupt()

StopOnInterrupt gracefully shuts down when ctrl-c is pressed or termination signal is received.

Jump to

Keyboard shortcuts

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