http

package
v0.0.0-...-ab260a3 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2019 License: Apache-2.0 Imports: 11 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 GrpcClient

type GrpcClient interface {
	IsReady() bool
	Invoke(ctx context.Context,
		serviceName string,
		methodName string,
		message []byte,
		md *metadata.Metadata,
	) (response []byte, err error)
	Introspect() (response []byte, err error)
}

GrpcClient is a dynamic gRPC client that performs reflection

type Server

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

Server is a grpc-mate server

func New

func New(grpcClient GrpcClient, logger *zap.Logger) *Server

New creates a new grpc-mate 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) HealthCheckHandler

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

HealthCheckHandler returns a status code 200 response for liveness probes

func (*Server) IntrospectHandler

func (s *Server) IntrospectHandler(client GrpcClient) http.HandlerFunc

IntrospectHandler handles requests that introspects all services and types

func (*Server) RPCCallHandler

func (s *Server) RPCCallHandler(client GrpcClient) http.HandlerFunc

RPCCallHandler handles requests for making gRPC calls

func (*Server) Serve

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

Serve starts the Server and serves requests

Jump to

Keyboard shortcuts

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