server

package
v0.0.0-...-5f133c6 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: BSD-3-Clause, BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloudRun

func CloudRun(mux http.Handler, grpcs *grpc.Server)

CloudRun starts an HTTP and gRPC server handling requests for all on the same port, determined by the env var $PORT. If no HTTP mux or gRPC server is provided (is nil), one with default routes/services will be started, respectively.

CloudRun() is a helper for servers that run in Google Cloud run, and thus starts a server that supports the following protocols:

✔ grpc ✗ grpc-web via websockets ✗ HTTP 1.1 ✔ HTTP 2.0

TODO(INFRA-211): Merge with above Run() function if possible, and add tests that verify the protocol compatibility table above either way.

func Run

func Run(ctx context.Context, mux http.Handler, grpcs *grpc.Server, lis net.Listener) error

Run() starts a server supporting the following protocols:

✔ grpc ✔ grpc-web via websockets ✔ HTTP 1.1 ✗ HTTP 2.0 (hijacked by grpc support)

Types

This section is empty.

Jump to

Keyboard shortcuts

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