launcher

package
v0.0.0-...-388d6c9 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MIT Imports: 31 Imported by: 0

Documentation

Overview

Package launcher provides a launcher to start gRPC server, health server and grpc gateway server. filter.go provides a filter to handle gRPC-Gateway requests.

Package launcher provides a launcher to start gRPC server, health server and grpc gateway server. interceptor.go provides interceptor to handle gRPC requests.

Package launcher provides a launcher to start gRPC server, health server and grpc gateway server.

Package launcher provides a launcher to start gRPC server, health server and grpc gateway server. response_proxy.go provides a response proxy to log the response.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(h http.Handler, decors ...GwMuxDecorator) http.Handler

Handler is a http.Handler that serves gRPC-Gateway requests.

func StartGRPCServer

func StartGRPCServer(config *configs.BaseConfig, opts ...StartServiceFunc) (
	*grpc.Server, *health.Server)

StartGRPCServer starts the gRPC server with the given service. It serves the given gRPC service and the gRPC-healthz.

func StartHTTPServer

func StartHTTPServer(config *configs.BaseConfig, healthEndpointPath, swaggerEndpointPath string) *http.Server

StartHTTPServer starts the HTTP server with the given service. It serves the gRPC-gateway, gRPC-healthz and the swagger UI. StartHTTPServer must be called after StartGRPCServer, because it uses the same listener, and HTTP server base on gRPC Gateway.

func WithRedirectToHTTPS

func WithRedirectToHTTPS(h http.Handler) http.Handler

WithRedirectToHTTPS returns a GwMuxDecorator that redirects HTTP requests to HTTPS.

func WithRequestLog

func WithRequestLog(h http.Handler) http.Handler

WithRequestLog returns a GwMuxDecorator that logs the request.

Types

type GwMuxDecorator

type GwMuxDecorator func(http.Handler) http.Handler

GwMuxDecorator is a decorator for http.Handler.

type StartServiceFunc

type StartServiceFunc func(server *grpc.Server, serviceName *string) error

StartServiceFunc is a function that starts a service. Note that the service name is passed by reference and can be modified.

Jump to

Keyboard shortcuts

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