http

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter func(handlerFunc http.HandlerFunc) http.HandlerFunc

Adapter represents a middleware adapter

type Client

type Client interface {
	Connect(context.Context, *url.URL) error
	CloseConn() error
	Call(context.Context,
		string,
		string,
		[]byte,
		*metadata.Metadata,
	) ([]byte, error)
}

Client is a dynamic gRPC client that performs reflection

type Discoverer

type Discoverer interface {
	Resolve(svc, version string) (*url.URL, error)
}

Discoverer performs service discover

type Server

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

Server is an grpc-http-proxy server

func New

func New(token string,
	discoverer Discoverer,
	logger *zap.Logger,
) *Server

New creates a new Server

func (*Server) CatchAllHandler

func (s *Server) CatchAllHandler() http.HandlerFunc

CatchAllHandler handles requests for non-existing paths This is done explicitly in order to have the logger middleware log the fact

func (*Server) LivenessProbeHandler

func (s *Server) LivenessProbeHandler() http.HandlerFunc

LivenessProbeHandler returns a status code 200 response for liveness probes

func (*Server) RPCCallHandler

func (s *Server) RPCCallHandler(newClient func() Client) http.HandlerFunc

RPCCallHandler handles requests for making gRPC calls

func (*Server) Serve

func (s *Server) Serve(ln net.Listener) error

Serve starts the Server

Jump to

Keyboard shortcuts

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