proxygen
proxygen::MockRequestHandler Class Reference

#include <Mocks.h>

Inheritance diagram for proxygen::MockRequestHandler:
proxygen::RequestHandler

Public Member Functions

 GMOCK_METHOD1_ (, noexcept,, setResponseHandler, void(ResponseHandler *))
 
 GMOCK_METHOD1_ (, noexcept,, onRequest, void(std::shared_ptr< HTTPMessage >))
 
 GMOCK_METHOD1_ (, noexcept,, onBody, void(std::shared_ptr< folly::IOBuf >))
 
 GMOCK_METHOD1_ (, noexcept,, onUpgrade, void(UpgradeProtocol))
 
 GMOCK_METHOD0_ (, noexcept,, onEOM, void())
 
 GMOCK_METHOD0_ (, noexcept,, requestComplete, void())
 
 GMOCK_METHOD1_ (, noexcept,, onError, void(ProxygenError))
 
 GMOCK_METHOD0_ (, noexcept,, onEgressPaused, void())
 
 GMOCK_METHOD0_ (, noexcept,, onEgressResumed, void())
 
 GMOCK_METHOD0_ (, noexcept,, canHandleExpect, bool())
 
void onRequest (std::unique_ptr< HTTPMessage > headers) noexceptoverride
 
void onBody (std::unique_ptr< folly::IOBuf > body) noexceptoverride
 
- Public Member Functions inherited from proxygen::RequestHandler
virtual void setResponseHandler (ResponseHandler *handler) noexcept
 
virtual void onUpgrade (proxygen::UpgradeProtocol prot) noexcept=0
 
virtual void onEOM () noexcept=0
 
virtual void requestComplete () noexcept=0
 
virtual void onError (ProxygenError err) noexcept=0
 
virtual void onEgressPaused () noexcept
 
virtual void onEgressResumed () noexcept
 
virtual bool canHandleExpect () noexcept
 
virtual ExMessageHandlergetExHandler () noexcept
 
virtual ResponseHandlergetDownstream () noexcept
 
virtual ~RequestHandler ()
 

Additional Inherited Members

- Protected Attributes inherited from proxygen::RequestHandler
ResponseHandlerdownstream_ {nullptr}
 

Detailed Description

Definition at line 63 of file Mocks.h.

Member Function Documentation

proxygen::MockRequestHandler::GMOCK_METHOD0_ ( noexcept  ,
onEOM  ,
void()   
)
proxygen::MockRequestHandler::GMOCK_METHOD0_ ( noexcept  ,
requestComplete  ,
void()   
)
proxygen::MockRequestHandler::GMOCK_METHOD0_ ( noexcept  ,
onEgressPaused  ,
void()   
)
proxygen::MockRequestHandler::GMOCK_METHOD0_ ( noexcept  ,
onEgressResumed  ,
void()   
)
proxygen::MockRequestHandler::GMOCK_METHOD0_ ( noexcept  ,
canHandleExpect  ,
bool()   
)
proxygen::MockRequestHandler::GMOCK_METHOD1_ ( noexcept  ,
setResponseHandler  ,
void(ResponseHandler *)   
)
proxygen::MockRequestHandler::GMOCK_METHOD1_ ( noexcept  ,
onRequest  ,
void(std::shared_ptr< HTTPMessage >)   
)
proxygen::MockRequestHandler::GMOCK_METHOD1_ ( noexcept  ,
onBody  ,
void(std::shared_ptr< folly::IOBuf >)   
)
proxygen::MockRequestHandler::GMOCK_METHOD1_ ( noexcept  ,
onUpgrade  ,
void(UpgradeProtocol  
)
proxygen::MockRequestHandler::GMOCK_METHOD1_ ( noexcept  ,
onError  ,
void(ProxygenError  
)
void proxygen::MockRequestHandler::onBody ( std::unique_ptr< folly::IOBuf body)
inlineoverridevirtualnoexcept

Invoked when we get part of body for the request.

Implements proxygen::RequestHandler.

Definition at line 89 of file Mocks.h.

89  {
90  if (body) {
91  onBody(std::shared_ptr<folly::IOBuf>(body.release()));
92  } else {
93  onBody(std::shared_ptr<folly::IOBuf>(nullptr));
94  }
95  }
void onBody(std::unique_ptr< folly::IOBuf > body) noexceptoverride
Definition: Mocks.h:89
void proxygen::MockRequestHandler::onRequest ( std::unique_ptr< HTTPMessage headers)
inlineoverridevirtualnoexcept

Invoked when we have successfully fetched headers from client. This will always be the first callback invoked on your handler.

Implements proxygen::RequestHandler.

Definition at line 85 of file Mocks.h.

85  {
86  onRequest(std::shared_ptr<HTTPMessage>(headers.release()));
87  }
void onRequest(std::unique_ptr< HTTPMessage > headers) noexceptoverride
Definition: Mocks.h:85

The documentation for this class was generated from the following file: