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. |
Click to show internal directories.
Click to hide internal directories.