grpc_module

package
v0.0.0-...-53c1a21 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = wrappedCfg{
	Grpc: Config{
		ListenAddr:    "0.0.0.0",
		ListenPort:    4000,
		LogAllRequest: true,
	},
}

Functions

func CheckConfig

func CheckConfig(cfg Config) error

func Dial

func Dial(addr string, opts ...grpc.DialOption) (*grpc.ClientConn, error)

func Module

func Module() fx.Option

func MustDial

func MustDial(addr string, opts ...grpc.DialOption) *grpc.ClientConn

func NewGRPCServer

func NewGRPCServer(lc fx.Lifecycle, cfg Config, svcCfg svc_module.OptionalConfig, svOpts grpcServerOptionsParams, logger *zap.Logger, ocfg optionalParams) (*grpc.Server, http_module.HttpOptions)

func WithServerOptions

func WithServerOptions(options ...grpc.ServerOption) fx.Option

Types

type Config

type Config struct {
	ListenAddr       string   `mapstructure:"listen-addr" validate:"required,ip"`
	ListenPort       int      `mapstructure:"listen-port" validate:"required,gt=0,lte=65535"`
	LogAllRequest    bool     `mapstructure:"log-all-request"`
	LogIgnoreMethods []string `mapstructure:"log-ignore-methods"`
}

func ReadConfig

func ReadConfig(v *viper.Viper) (Config, error)

type GRPCServerOptions

type GRPCServerOptions struct {
	fx.Out

	Options []grpc.ServerOption `group:"grpc_server_option,flatten"`
}

Jump to

Keyboard shortcuts

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