errorintercept

package
v0.0.0-...-0f6a5af Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "clutch.middleware.errorintercept"

Variables

This section is empty.

Functions

func New

func New(cfg *anypb.Any, logger *zap.Logger, scope tally.Scope) (middleware.Middleware, error)

Types

type Interceptor

type Interceptor interface {
	InterceptError(error) error
}

Implement this interface in a service to have the ConvertError function registered into middleware.

type Middleware

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

func NewMiddleware

func NewMiddleware(cfg *anypb.Any, logger *zap.Logger, scope tally.Scope) (*Middleware, error)

func (*Middleware) AddInterceptor

func (m *Middleware) AddInterceptor(fn errorInterceptorFunc)

AddInterceptor is used during gateway start to register any service that implements the Interceptor interface.

func (*Middleware) UnaryInterceptor

func (m *Middleware) UnaryInterceptor() grpc.UnaryServerInterceptor

Jump to

Keyboard shortcuts

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