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 ¶
- func Handler(h http.Handler, decors ...GwMuxDecorator) http.Handler
- func StartGRPCServer(config *configs.BaseConfig, opts ...StartServiceFunc) (*grpc.Server, *health.Server)
- func StartHTTPServer(config *configs.BaseConfig, healthEndpointPath, swaggerEndpointPath string) *http.Server
- func WithRedirectToHTTPS(h http.Handler) http.Handler
- func WithRequestLog(h http.Handler) http.Handler
- type GwMuxDecorator
- type StartServiceFunc
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 ¶
WithRedirectToHTTPS returns a GwMuxDecorator that redirects HTTP requests to HTTPS.
Types ¶
type GwMuxDecorator ¶
GwMuxDecorator is a decorator for http.Handler.