Documentation
¶
Index ¶
- func ContextMiddleware(timeout time.Duration, logger logger.LoggerInterface) grpc.UnaryServerInterceptor
- func GenerateRequestID() string
- func Method(ctx context.Context) string
- func Operation(ctx context.Context) string
- func PyroscopeUnaryInterceptor() grpc.UnaryServerInterceptor
- func RecoveryMiddleware(logger logger.LoggerInterface) grpc.UnaryServerInterceptor
- func RequestID(ctx context.Context) string
- func StartTime(ctx context.Context) time.Time
- func WithMethod(ctx context.Context, method string) context.Context
- func WithOperation(ctx context.Context, operation string) context.Context
- func WithRequestID(ctx context.Context, id string) context.Context
- func WithStartTime(ctx context.Context, t time.Time) context.Context
- type ResilienceInterceptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextMiddleware ¶
func ContextMiddleware(timeout time.Duration, logger logger.LoggerInterface) grpc.UnaryServerInterceptor
func GenerateRequestID ¶
func GenerateRequestID() string
func PyroscopeUnaryInterceptor ¶
func PyroscopeUnaryInterceptor() grpc.UnaryServerInterceptor
func RecoveryMiddleware ¶
func RecoveryMiddleware(logger logger.LoggerInterface) grpc.UnaryServerInterceptor
Types ¶
type ResilienceInterceptor ¶
type ResilienceInterceptor struct {
LoadMonitor *resilience.LoadMonitor
CircuitBreaker *resilience.CircuitBreaker
RequestLimiter *resilience.RequestLimiter
}
func NewResilienceInterceptor ¶
func NewResilienceInterceptor(lm *resilience.LoadMonitor, cb *resilience.CircuitBreaker, rl *resilience.RequestLimiter) *ResilienceInterceptor
func (*ResilienceInterceptor) UnaryInterceptor ¶
func (im *ResilienceInterceptor) UnaryInterceptor() grpc.UnaryServerInterceptor
Click to show internal directories.
Click to hide internal directories.