middleware

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TimeoutInterceptor

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

TimeoutInterceptor sets the timeout in each request.

func NewTimeoutInterceptor

func NewTimeoutInterceptor(timeout time.Duration, logger logger.Logger) *TimeoutInterceptor

NewTimeoutInterceptor returns new TimeoutInterceptor that timeouts request if it exceeds the timeout value.

func (*TimeoutInterceptor) NewStreamTimeoutInterceptor

func (h *TimeoutInterceptor) NewStreamTimeoutInterceptor() grpc.StreamServerInterceptor

NewStreamTimeoutInterceptor returns an interceptor that will timeout according to the configured timeout. We need to use this middleware instead of relying on runtime.DefaultContextTimeout to allow us to return proper error code.

func (*TimeoutInterceptor) NewUnaryTimeoutInterceptor

func (h *TimeoutInterceptor) NewUnaryTimeoutInterceptor() grpc.UnaryServerInterceptor

NewUnaryTimeoutInterceptor returns an interceptor that will timeout according to the configured timeout. We need to use this middleware instead of relying on runtime.DefaultContextTimeout to allow us to return proper error code.

Directories

Path Synopsis
Package http contains middleware and utility functions to modify HTTP requests and responses.
Package http contains middleware and utility functions to modify HTTP requests and responses.
Package logging contains logging middleware.
Package logging contains logging middleware.
Package requestid contains middleware to inject and manage request id context.
Package requestid contains middleware to inject and manage request id context.
Package storeid contains middleware to inject and manage the store ID context.
Package storeid contains middleware to inject and manage the store ID context.
Package validator contains middleware that validates API input parameters.
Package validator contains middleware that validates API input parameters.

Jump to

Keyboard shortcuts

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