Documentation ¶
Overview ¶
Simple utility to start a gRPC Service Consumer should: 1. Implement `InterfaceGRPC` 2. Call: RunGRPC()
Index ¶
- func RunGRPC(service InterfaceGRPC) error
- func RunGRPCAndREST(service InterfaceGRPCWithHTTPHandler) error
- func StartHTTPProxy(service InterfaceGRPCWithHTTPHandler, config GRPCConfig) error
- type GRPCConfig
- type InterfaceGRPC
- type InterfaceGRPCWithHTTPHandler
- type UnimplementedGRPCServer
- type UnimplementedGRPCWithHTTPHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunGRPCAndREST ¶
func RunGRPCAndREST(service InterfaceGRPCWithHTTPHandler) error
Start a gRPC Service with a REST endpoint too
func StartHTTPProxy ¶
func StartHTTPProxy(service InterfaceGRPCWithHTTPHandler, config GRPCConfig) error
Start HTTP Proxy to gRPC
Types ¶
type GRPCConfig ¶
type GRPCConfig struct { // Set env variable GCP_GRPC_HOST. Default value is 0.0.0.0 GRPC_Host string `default:"0.0.0.0"` // Set env variable GCP_GRPC_PORT. Default value is 8080 GRPC_Port string `default:"8080"` // Set env variable GCP_HTTP_PORT. Default value is 8090 HTTP_Port string `default:"8090"` }
Config for gRPC Server
type InterfaceGRPC ¶
type InterfaceGRPCWithHTTPHandler ¶
type InterfaceGRPCWithHTTPHandler interface { RegisterHTTPHandler(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) InterfaceGRPC }
type UnimplementedGRPCServer ¶
type UnimplementedGRPCServer struct { }
type UnimplementedGRPCWithHTTPHandler ¶
type UnimplementedGRPCWithHTTPHandler struct { }
func (UnimplementedGRPCWithHTTPHandler) Register ¶
func (UnimplementedGRPCWithHTTPHandler) Register(server *grpc.Server) error
func (UnimplementedGRPCWithHTTPHandler) RegisterHTTPHandler ¶
func (UnimplementedGRPCWithHTTPHandler) RegisterHTTPHandler(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
Click to show internal directories.
Click to hide internal directories.