serverutil

package
Version: v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2020 License: Apache-2.0 Imports: 14 Imported by: 4

Documentation

Overview

Package serverutil provides helper functions to main.go files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GRPCGatewayServer added in v0.3.0

func GRPCGatewayServer(ctx context.Context,
	grpcServer *grpc.Server, conn *grpc.ClientConn,
	services ...RegisterServiceFromConn) (*http.Server, error)

GRPCGatewayServer returns a server for given services over HTTP / JSON and gRPC.

func ListenForCtrlC added in v0.3.0

func ListenForCtrlC(servers ...interface{ Shutdown(context.Context) error })

ListenForCtrlC gracefully stops all the servers on an interrupt signal.

func ListenTLS added in v0.2.0

func ListenTLS(ctx context.Context, listenAddr, certFile, keyFile string) (net.Listener, *grpc.ClientConn, func(), error)

ListenTLS binds to listenAddr and returns a gRPC connection to it.

func MetricsServer added in v0.3.0

func MetricsServer(addr string, opts *server.Options) *server.Server

MetricsServer returns server with monitoring APIs

func RootHealthHandler added in v0.2.0

func RootHealthHandler(otherHandler http.Handler) http.HandlerFunc

RootHeaalthHandler handles liveness checks at "/". All other requests are passed through to `otherHandler`.

Types

type RegisterServiceFromConn added in v0.2.0

type RegisterServiceFromConn func(context.Context, *runtime.ServeMux, *grpc.ClientConn) error

RegisterServiceFromConn registers services with a grpc server's ServeMux

Jump to

Keyboard shortcuts

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