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 ¶
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) 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.
Click to show internal directories.
Click to hide internal directories.