Documentation ¶
Overview ¶
Package server provides HTTP/2 gRCP server functionality.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GRPC ¶
GRPC is responsible to act as gRPC server. It composes grpc.Server.
func NewGRPC ¶
func NewGRPC(port string, options ...grpc.ServerOption) *GRPC
NewGRPC creates an instance of GRPC.
func (*GRPC) AwaitTermination ¶
AwaitTerminations blocks the server and wait for termination signal. The termination signal must be one of SIGINT or SIGTERM. Once it receives one of those signals, the gRPC server will perform graceful stop and close the listener.
func (*GRPC) RegisterServices ¶
func (g *GRPC) RegisterServices(fns ...RegisterServiceFunc)
RegisterServices registers gRPC service to gRPC server.
type RegisterEndpointFunc ¶
RegisterEndpointFunc defines function contract to register endpoint.
type RegisterServiceFunc ¶
RegisterServiceFunc defines function contract to register service.
type Rest ¶
Rest is responsible to act as HTTP/1.1 REST server. It composes grpc-gateway runtime.ServeMux.
func (*Rest) EnablePrometheus ¶
EnablePrometheus enables prometheus endpoint. It can be accessed via /metrics.
func (*Rest) RegisterEndpoints ¶
func (r *Rest) RegisterEndpoints(fns ...RegisterEndpointFunc) error
RegisterEndpoints registers HTTP/1.1 REST endpoints. If there are some errors, it returns the first error it encounter and stop the iteration.