serverutil

package
v0.2.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2020 License: Apache-2.0 Imports: 11 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 Healthz added in v0.2.0

func Healthz() http.HandlerFunc

Healthz is a liveness handler that always responds with HTTP 200.

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 Readyz added in v0.2.0

func Readyz(db *sql.DB) http.HandlerFunc

Readyz is a readiness probe.

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`.

func ServeHTTPAPIAndGRPC added in v0.2.0

func ServeHTTPAPIAndGRPC(ctx context.Context, lis net.Listener,
	grpcServer *grpc.Server, conn *grpc.ClientConn,
	services ...RegisterServiceFromConn) error

ServeAPIGatewayAndGRPC serves the given services over HTTP / JSON and gRPC.

func ServeHTTPMetrics added in v0.2.0

func ServeHTTPMetrics(addr string, ready http.HandlerFunc) error

ServeHTTPMetrics serves monitoring APIs

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