grpc

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2021 License: Unlicense Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ServerModule for fx.
	ServerModule = fx.Provide(NewServer)

	// Module for fx.
	Module = fx.Options(ServerModule, fx.Provide(UnaryServerInterceptor), fx.Provide(StreamServerInterceptor))
)

Functions

func NewClient

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

NewClient to host for gRPC.

func NewServer

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

NewServer for gRPC.

func StreamServerInterceptor added in v1.17.0

func StreamServerInterceptor() []grpc.StreamServerInterceptor

StreamServerInterceptor for gRPC.

func UnaryServerInterceptor added in v1.17.0

func UnaryServerInterceptor() []grpc.UnaryServerInterceptor

UnaryServerInterceptor for gRPC.

Types

type ClientParams added in v1.17.0

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

ClientParams for gRPC.

type ServerParams added in v1.17.0

type ServerParams struct {
	fx.In

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

ServerParams for gRPC.

Directories

Path Synopsis
logger
zap
security
trace

Jump to

Keyboard shortcuts

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