grpc

package
v1.47.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2022 License: Unlicense Imports: 20 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(context context.Context, params *ClientParams, opts ...grpc.DialOption) (*grpc.ClientConn, error)

NewClient to host for gRPC.

func NewLocalClient added in v1.46.0

func NewLocalClient(context context.Context, params *ClientParams) (*grpc.ClientConn, error)

NewLocalClient to localhost for gRPC.

func NewServer

func NewServer(lc fx.Lifecycle, s fx.Shutdowner, params ServerParams, opts ...grpc.ServerOption) *grpc.Server

NewServer for gRPC.

func StreamServerInterceptor

func StreamServerInterceptor() []grpc.StreamServerInterceptor

StreamServerInterceptor for gRPC.

func UnaryServerInterceptor

func UnaryServerInterceptor() []grpc.UnaryServerInterceptor

UnaryServerInterceptor for gRPC.

Types

type ClientParams

type ClientParams struct {
	Host   string
	Config *Config
	Logger *zap.Logger
	Unary  []grpc.UnaryClientInterceptor
	Stream []grpc.StreamClientInterceptor
}

ClientParams for gRPC.

type Config

type Config struct {
	Port      string           `yaml:"port"`
	UserAgent string           `yaml:"user_agent"`
	Retry     retry.Config     `yaml:"retry"`
	RateLimit ratelimit.Config `yaml:"rate_limit"`
}

Config for gRPC.

type ServerParams

type ServerParams struct {
	fx.In

	Config *Config
	Logger *zap.Logger
	Unary  []grpc.UnaryServerInterceptor
	Stream []grpc.StreamServerInterceptor
}

ServerParams for gRPC.

Directories

Path Synopsis
logger
zap
security
jwt
trace

Jump to

Keyboard shortcuts

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