espresso

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2021 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProdLoggerMiddleware

func NewProdLoggerMiddleware(next http.Handler) http.Handler

Types

type Configuration

type Configuration struct {
	Port               int
	RelayPin           int
	BoilerThermCsPin   int
	BoilerThermClkPin  int
	BoilerThermMisoPin int
}

type GRPCWebServer

type GRPCWebServer struct {
	// contains filtered or unexported fields
}

func NewGRPCWebServer

func NewGRPCWebServer(server *grpc.Server) *GRPCWebServer

func (*GRPCWebServer) Listen

func (s *GRPCWebServer) Listen(listener net.Listener, enableDevLogger bool) error

type Server

type Server struct {
	// contains filtered or unexported fields
}

func New

func New(c Configuration) *Server

func (*Server) Run

func (s *Server) Run() error

func (*Server) Shutdown

func (s *Server) Shutdown() error

type WebMiddleware

type WebMiddleware struct {
	*grpcweb.WrappedGrpcServer
}

WebMiddleware to handle gRPC calls from browser. It is also able to isolate REST traffic and handle it accordingly

func NewGrpcWebMiddleware

func NewGrpcWebMiddleware(grpcWeb *grpcweb.WrappedGrpcServer) *WebMiddleware

func (*WebMiddleware) Handler

func (m *WebMiddleware) Handler(next http.Handler) http.Handler

Handler to isolate gRPC vs. non-gRPC requests.

If the incoming traffic is gRPC, use grpc web to unmarshal the incoming grpc request. If the call is not gRPC web, then it is treated like regular REST.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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