httpserver

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2020 License: BSD-3-Clause Imports: 15 Imported by: 0

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

type SyncRPCHttpServer struct {
	*http2.H2CServer
	// contains filtered or unexported fields
}

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL