utils

package
v0.0.38 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2020 License: MIT Imports: 9 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateGRPCClient

func CreateGRPCClient(name string, log *zap.Logger) *grpc.ClientConn

CreateGRPCClient is used to create a GRPC Service's client

func CreateGRPCServer

func CreateGRPCServer(name string, log *zap.Logger) (*grpc.Server, *net.Listener)

CreateGRPCServer is used to create a GRPC server for microservice

func CreateMongoDB added in v0.0.10

func CreateMongoDB(address string, log *zap.Logger) *mongo.Client

CreateMongoDB creates a mongoDB client

func HandlePanic

func HandlePanic(log *zap.Logger)

HandlePanic is used to handle panic when it occurs in a microservice

Types

type LogInterceptor added in v0.0.16

type LogInterceptor struct {
	// contains filtered or unexported fields
}

LogInterceptor logs all communications

func (LogInterceptor) LogGRPCInterceptor added in v0.0.16

func (l LogInterceptor) LogGRPCInterceptor(ctx context.Context,
	req interface{},
	info *grpc.UnaryServerInfo,
	handler grpc.UnaryHandler) (interface{}, error)

LogGRPCInterceptor logs all grpc communications

Jump to

Keyboard shortcuts

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