gateway

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 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 GatewayOpt

type GatewayOpt func(*GatewayServer)

func WithGrpcService

func WithGrpcService(endpoint string, connector GrpcConnector) GatewayOpt

WithGrpcService registers a grpc service with the gateway server.

func WithLogger

func WithLogger(logger log.Logger) GatewayOpt

WithLogger sets the logger for the gateway server.

func WithMiddleware

func WithMiddleware(m *middleware.NamedMiddleware) GatewayOpt

WithMiddleware adds a middleware to the gateway server.

type GatewayServer

type GatewayServer struct {
	http.Server
	// contains filtered or unexported fields
}

GatewayServer is an HTTP server that can forward requests to GRPC servers.

func NewGateway

func NewGateway(ctx context.Context, httpAddress string, opts ...GatewayOpt) (*GatewayServer, error)

func (*GatewayServer) Shutdown

func (g *GatewayServer) Shutdown(ctx context.Context) error

func (*GatewayServer) Start

func (g *GatewayServer) Start() error

Start starts the gateway server This simply calls the HttpServer's ListenAndServe method, but is renamed for conformance with other servers

type GrpcConnector

type GrpcConnector func(ctx context.Context, mux *runtime.ServeMux, address string, opts []grpc.DialOption) error

GrpcConnector is a function that connects the gateway to a GRPC server.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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