grpc

package
v2.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGateway

func NewGateway(
	ctx context.Context,
	conn *grpc.ClientConn,
	logger *logger.Logger,
	callOpts ...GatewayCallOption,
) (http.Handler, error)

Types

type GRPCServiceRegister

type GRPCServiceRegister func(s reflection.GRPCServer)

type GatewayCallOption

type GatewayCallOption func(*gatewayOptions)

func WithHandlers

func WithHandlers(handlers ...func(ctx context.Context, serveMux *runtime.ServeMux, clientConn *grpc.ClientConn) error) GatewayCallOption

func WithServerMuxOptions

func WithServerMuxOptions(opts ...runtime.ServeMuxOption) GatewayCallOption

type HttpHandler

type HttpHandler = func(ctx context.Context, serveMux *runtime.ServeMux, clientConn *grpc.ClientConn) error

type Register

type Register struct {
	HttpHandlers []HttpHandler
	GrpcServices []GRPCServiceRegister
	EchoHandlers map[string]map[string]echo.HandlerFunc
}

func NewRegister

func NewRegister() *Register

func (*Register) RegisterEchoHandler

func (r *Register) RegisterEchoHandler(path string, method string, handler echo.HandlerFunc)

func (*Register) RegisterGrpcService

func (r *Register) RegisterGrpcService(serviceRegister GRPCServiceRegister)

func (*Register) RegisterHttpHandler

func (r *Register) RegisterHttpHandler(handler HttpHandler)

func (*Register) RegisterHttpHandlers

func (r *Register) RegisterHttpHandlers(handlers []HttpHandler)

Jump to

Keyboard shortcuts

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