grpc

package
v0.0.0-...-ad3f877 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Simple utility to start a gRPC Service Consumer should: 1. Implement `InterfaceGRPC` 2. Call: RunGRPC()

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunGRPC

func RunGRPC(service InterfaceGRPC) error

Start the gRPC server

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 InterfaceGRPC interface {
	Register(*grpc.Server)
}

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) RegisterHTTPHandler

func (UnimplementedGRPCWithHTTPHandler) RegisterHTTPHandler(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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