grpc

package
v1.1.32 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Provide(
	NewGRPC,
)

Module for uber fx constructor

Functions

func NewClient

func NewClient(host string) (*grpc.ClientConn, error)

NewClient new grpc client

func NewGRPC

func NewGRPC(config *Config) (*grpc.Server, net.Listener, error)

NewGRPC new grpc server and add default interceptor

func RunGRPC

func RunGRPC(listener net.Listener, service *grpc.Server, lifecycle fx.Lifecycle)

RunGRPC start grpc server by use uber fx

Types

type Config

type Config struct {
	Mode        string `mapstructure:"mode"`
	Port        string `mapstructure:"port"`
	RequestDump bool   `mapstructure:"request_dump"` // true or false
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳