cmd

package
v0.0.0-...-5d8c97e Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2019 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandlerOnGRPC

func NewHandlerOnGRPC(ctx context.Context, healthService *service.HealthService, claculatorService *service.CalculatorService, logger *zap.Logger) (http.Handler, error)

NewHandlerOnGRPC 创建基于GRPC的服务处理器

func NewHandlerOnHTTP

func NewHandlerOnHTTP(ctx context.Context, healthService *service.HealthService, claculatorService *service.CalculatorService, logger *zap.Logger) (http.Handler, error)

NewHandlerOnHTTP 创建基于HTTP的服务处理器

func ServerMiddlewares

func ServerMiddlewares() endpoint.Middleware

ServerMiddlewares 服务端endpoint中间件

Types

type ErrorLogHandler

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

ErrorLogHandler 错误日志处理器 实现kit/transport.ErrorHandler接口 用来替换默认的错误日志处理器

func NewErrorLogHandler

func NewErrorLogHandler(logger *zap.Logger) *ErrorLogHandler

NewErrorLogHandler 创建错误日志处理器

func (*ErrorLogHandler) Handle

func (handler *ErrorLogHandler) Handle(ctx context.Context, err error)

Handle 处理错误,写日志

Directories

Path Synopsis
transport

Jump to

Keyboard shortcuts

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