Documentation ¶
Index ¶
- func CreateGatewayHandler(grpcPort uint16, mux *http.ServeMux, apiBasePath string, ...) (shutdown func())
- func CreateGrpcServer(keepaliveParams keepalive.ServerParameters, ...) *grpc.Server
- func CreateShutdownHandler(ctx context.Context, gracePeriod time.Duration, grpcServer *grpc.Server) func() error
- func Listen(port uint16, grpcServer *grpc.Server, wg *sync.WaitGroup)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateGatewayHandler ¶
func CreateGatewayHandler( grpcPort uint16, mux *http.ServeMux, apiBasePath string, corsAllowedOrigins []string, spec string, handlers ...func(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error, ) (shutdown func())
CreateGatewayHandler configures the gRPC API gateway by registering relevant handlers with the given mux.
func CreateGrpcServer ¶
func CreateGrpcServer( keepaliveParams keepalive.ServerParameters, keepaliveEnforcementPolicy keepalive.EnforcementPolicy, authServices []authorization.AuthService, tlsConfig configuration.TlsConfig, ) *grpc.Server
CreateGrpcServer creates a gRPC server (by calling grpc.NewServer) with settings specific to this project, and registers services for, e.g., logging and authentication.
func CreateShutdownHandler ¶ added in v0.3.48
func CreateShutdownHandler(ctx context.Context, gracePeriod time.Duration, grpcServer *grpc.Server) func() error
CreateShutdownHandler returns a function that shuts down the grpcServer when the context is closed. The server is given gracePeriod to perform a graceful showdown and is then forcably stopped if necessary
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
Package grpcpool provides a pool of grpc clients
|
Package grpcpool provides a pool of grpc clients |
Click to show internal directories.
Click to hide internal directories.