Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GRPCGateway ¶
type GRPCGateway struct {
// contains filtered or unexported fields
}
GRPCGateway helps in registering grpc-gateway proxy handlers for a grpc service on server.HTTPServer
func NewGateway ¶
func NewGateway(host string, port int, opts ...GatewayOption) (*GRPCGateway, error)
NewGateway creates a new server.GRPCGateway to proxy grpc requests to specified host and port.
func (*GRPCGateway) RegisterHandler ¶
func (s *GRPCGateway) RegisterHandler(ctx context.Context, f func(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)) error
RegisterHandler helps in adding routes and handlers to be used for proxying requests to grpc service given the grpc-gateway generated Register*ServiceHandlerFromEndpoint function
type GRPCOption ¶
type GRPCOption func(*grpcOptions)
GRPCOption sets configs, properties or other parameters for the server.GRPCServer
func WithGRPCServer ¶
func WithGRPCServer(grpcServer *grpc.Server) GRPCOption
WithGRPCServer sets grpc.Server instance for server.GRPCServer
func WithGRPCServerOptions ¶
func WithGRPCServerOptions(opts ...grpc.ServerOption) GRPCOption
WithGRPCServerOptions sets []grpc.ServerOption for server.GRPCServer
type GRPCServer
deprecated
type GRPCServer struct {
// contains filtered or unexported fields
}
GRPCServer is an server to serve grpc requests
Deprecated: Prefer `mux` package instead of this.
func NewGRPC
deprecated
func NewGRPC(config Config, options ...GRPCOption) (*GRPCServer, error)
NewGRPC creates a new server.GRPCServer instance with given config and server.GRPCOption
Deprecated: Prefer `mux` package instead of this.
func (*GRPCServer) RegisterHealth ¶
func (s *GRPCServer) RegisterHealth() *health.Server
RegisterHealth adds standard grpc health check service to grpc server
func (*GRPCServer) RegisterService ¶
func (s *GRPCServer) RegisterService(sd *grpc.ServiceDesc, ss interface{})
func (*GRPCServer) Serve ¶
func (s *GRPCServer) Serve() error
Serve starts the configured grpc server to serve requests
func (*GRPCServer) Shutdown ¶
func (s *GRPCServer) Shutdown(ctx context.Context)
Shutdown gracefully stops the server, and kills the server when passed context is cancelled
type GatewayOption ¶
type GatewayOption func(*gatewayOptions)
GatewayOption sets configs, properties or other parameters for the server.GRPCGateway
func WithGRPCGateway ¶
func WithGRPCGateway(gwmux *runtime.ServeMux) GatewayOption
WithGRPCGateway sets runtime.ServeMux instance for server.GRPCGateway
func WithGatewayMuxOptions ¶
func WithGatewayMuxOptions(opts ...runtime.ServeMuxOption) GatewayOption
WithGatewayMuxOptions sets []runtime.ServeMuxOption for server.GRPCGateway
type HTTPOption ¶
type HTTPOption func(*httpOptions)
HTTPOption sets configs, properties or other parameters for the server.HTTPServer
func WithHTTPServer ¶
func WithHTTPServer(httpServer *http.Server) HTTPOption
WithHTTPServer sets http.Server instance for server.HTTPServer
type HTTPServer
deprecated
type HTTPServer struct {
// contains filtered or unexported fields
}
HTTPServer is an server to serve http requests
Deprecated: Prefer `mux` package instead of this.
func NewHTTP
deprecated
func NewHTTP(config Config, options ...HTTPOption) (*HTTPServer, error)
NewHTTP creates a new server.HTTPServer instance with given config and server.HTTPOption
Deprecated: Prefer `mux` package instead of this.
func (*HTTPServer) RegisterHandler ¶
func (s *HTTPServer) RegisterHandler(pattern string, handler http.Handler)
RegisterHandler registers provided pattern and handler on the http server
func (*HTTPServer) Serve ¶
func (s *HTTPServer) Serve() error
Serve starts the configured http server to serve requests
func (*HTTPServer) SetGateway ¶
func (s *HTTPServer) SetGateway(patternPrefix string, gw *GRPCGateway)
SetGateway sets a server.GRPCGateway instance on the http server to be proxy requests to a grpc service
func (*HTTPServer) Shutdown ¶
func (s *HTTPServer) Shutdown(ctx context.Context)
Shutdown gracefully stops the server, and kills the server when passed context is cancelled
type MuxOption ¶
type MuxOption func(*muxOptions)
MuxOption sets configs, properties or other parameters for the server.MuxServer
func WithMuxGRPCServer ¶
WithMuxGRPCServer sets grpc.Server instance for the internal grpc server of server.MuxServer
func WithMuxGRPCServerOptions ¶
func WithMuxGRPCServerOptions(opts ...grpc.ServerOption) MuxOption
WithMuxGRPCServerOptions sets []grpc.ServerOption for the internal grpc server of server.MuxServer
func WithMuxHTTPServer ¶
WithMuxHTTPServer sets http.Server instance for the internal http server of server.MuxServer
type MuxServer
deprecated
type MuxServer struct { GRPCServer HTTPServer // contains filtered or unexported fields }
MuxServer is an server to serve grpc requests and http requests on same host and port
Deprecated: Prefer `mux` package instead of this.
Directories ¶
Path | Synopsis |
---|---|
proto/gotocompany/common/v1
Package v1 is a reverse proxy.
|
Package v1 is a reverse proxy. |