grpc

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInternalServer = status.Error(codes.Internal, "errors.general.internal_error")
)
View Source
var ServerModule = fx.Module("grpcserver",
	fx.Provide(
		NewServer,
	),
	fx.Decorate(wrapLogger),
)

Functions

func AsService

func AsService(f any) any

AsService annotates the given constructor to state that it provides a GRPC service to the "grpcservices" group.

func InterceptorLogger

func InterceptorLogger(l *zap.Logger) logging.Logger

InterceptorLogger adapts zap logger to interceptor logger. This code is simple enough to be copied and not imported.

Types

type ServerParams

type ServerParams struct {
	fx.In

	LC fx.Lifecycle

	Logger   *zap.Logger
	Config   *config.Config
	DB       *sql.DB
	TP       *tracesdk.TracerProvider
	Services []Service `group:"grpcservices"`
	TokenMgr *auth.TokenMgr
	UserInfo userinfo.UserInfoRetriever
	Perms    perms.Permissions
}

type ServerResult

type ServerResult struct {
	fx.Out

	Server *grpc.Server
}

func NewServer

func NewServer(p ServerParams) (ServerResult, error)

type Service

type Service interface {
	RegisterServer(srv *grpc.Server)
}

Directories

Path Synopsis
interceptors
auth
Package auth is a middleware that authenticates incoming gRPC requests.
Package auth is a middleware that authenticates incoming gRPC requests.

Jump to

Keyboard shortcuts

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