code: func New(ctx context.Context, next http.Handler, config config.Buffering, name string) (http.Handler, error) {
  	logger := middlewares.GetLogger(ctx, name, typeName)
  	logger.Debug("Creating middleware")
  	logger.Debug("Setting up buffering: request limits: %d (mem), %d (max), response limits: %d (mem), %d (max) with retry: '%s'",
  		config.MemRequestBodyBytes, config.MaxRequestBodyBytes, config.MemResponseBodyBytes, config.MaxResponseBodyBytes, config.RetryExpression)
  
  	oxyBuffer, err := oxybuffer.New(
  		next,
  		oxybuffer.MemRequestBodyBytes(config.MemRequestBodyBytes),
  		oxybuffer.MaxRequestBodyBytes(config.MaxRequestBodyBytes),
  		oxybuffer.MemResponseBodyBytes(config.MemResponseBodyBytes),
  		oxybuffer.MaxResponseBodyBytes(config.MaxResponseBodyBytes),
  		oxybuffer.CondSetter(len(config.RetryExpression) > 0, oxybuffer.Retry(config.RetryExpression)),
  	)
  	if err != nil {
  		return nil, err
  	}
  
  	return &buffer{
  		name:   name,
  		buffer: oxyBuffer,
  	}, nil
  }
docs: // New creates a buffering middleware.