Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type SingleFlightMiddleware ¶
type SingleFlightMiddleware struct {
// contains filtered or unexported fields
}
SingleFlightMiddleware implements the singleflight pattern to deduplicate concurrent identical requests.
func (*SingleFlightMiddleware) Process ¶
func (m *SingleFlightMiddleware) Process(ctx context.Context, httpClient *http.Client, req *http.Request, next middleware.NextFunc) (*http.Response, error)
Process applies the singleflight pattern before passing the request to the next middleware.
func (*SingleFlightMiddleware) SetLogger ¶
func (m *SingleFlightMiddleware) SetLogger(l logger.Logger)
SetLogger sets the logger for the middleware.
Click to show internal directories.
Click to hide internal directories.