Documentation ¶
Overview ¶
Package httpserver is a http/2 h2c server. It's run within the same process as SyncRPC grpc servicer.
When a client wants to send a grpc request to some service on gateway with hardwareId hwId, it identifies the addr of the SyncRPC grpc servicer to which the gateway has a bidirectional stream to, and sends a grpc request to the httpServer that's within the same process of that grpc servicer.
This httpServer converts httpRequest to GatewayRequest, send it over to grpc servicer using GatewayRPCBroker, waits for a response, and converts the GatewayResponse to a HttpResponse and send it back to the client.
Index ¶
Constants ¶
View Source
const (
DefaultHttpResponseStatus = 200
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SyncRPCHttpServer ¶
func NewSyncRPCHttpServer ¶
func NewSyncRPCHttpServer(broker broker.GatewayRPCBroker) *SyncRPCHttpServer
func (*SyncRPCHttpServer) Run ¶
func (server *SyncRPCHttpServer) Run(addr string)
func (*SyncRPCHttpServer) Serve ¶
func (server *SyncRPCHttpServer) Serve(listener net.Listener)
Click to show internal directories.
Click to hide internal directories.