Documentation ¶
Overview ¶
Package server provides HTTP/2 to HTTP/1.1 gateway server functionality.
Index ¶
- type GrpcGateway
- func (gg *GrpcGateway) AttachService(fn func(*runtime.ServeMux) error)
- func (gg *GrpcGateway) EnableHealth() error
- func (gg *GrpcGateway) EnablePrometheus() error
- func (gg *GrpcGateway) GracefulStop()
- func (gg *GrpcGateway) Name() string
- func (gg *GrpcGateway) Port() string
- func (gg *GrpcGateway) Serve() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GrpcGateway ¶
type GrpcGateway struct {
// contains filtered or unexported fields
}
GrpcGateway is responsible to act as HTTP/1.1 server. It composes grpc-gateway runtime.ServeMux.
func NewGrpcGateway ¶
func NewGrpcGateway(port string) *GrpcGateway
NewGrpcGateway creates an instance of GrpcGateway with default production options attached. It enables Prometheus metrics by default.
func (*GrpcGateway) AttachService ¶
func (gg *GrpcGateway) AttachService(fn func(*runtime.ServeMux) error)
AttachService attaches service to gRPC Gateway server. It will be called before serve.
func (*GrpcGateway) EnableHealth ¶
func (gg *GrpcGateway) EnableHealth() error
EnableHealth enables health endpoint. It can be accessed via /health.
func (*GrpcGateway) EnablePrometheus ¶
func (gg *GrpcGateway) EnablePrometheus() error
EnablePrometheus enables prometheus endpoint. It can be accessed via /metrics.
func (*GrpcGateway) GracefulStop ¶
func (gg *GrpcGateway) GracefulStop()
GracefulStop exists just for the sake implementing server interface. It does nothing.
func (*GrpcGateway) Serve ¶
func (gg *GrpcGateway) Serve() error
Serve runs HTTP/1.1 runtime.ServeMux. It is a blocking method.