proxygen
proxygen::MockHTTPMessageFilter Class Reference

#include <MockHTTPMessageFilter.h>

Inheritance diagram for proxygen::MockHTTPMessageFilter:
proxygen::HTTPMessageFilter proxygen::HTTPTransactionHandler folly::DestructorCheck

Public Member Functions

 GMOCK_METHOD1_ (, noexcept,, onHeadersComplete, void(std::shared_ptr< HTTPMessage >))
 
void onHeadersComplete (std::unique_ptr< HTTPMessage > msg) noexceptoverride
 
 GMOCK_METHOD1_ (, noexcept,, onBody, void(std::shared_ptr< folly::IOBuf >))
 
void onBody (std::unique_ptr< folly::IOBuf > chain) noexceptoverride
 
 GMOCK_METHOD1_ (, noexcept,, onChunkHeader, void(size_t))
 
 GMOCK_METHOD0_ (, noexcept,, onChunkComplete, void())
 
 GMOCK_METHOD1_ (, noexcept,, onTrailers, void(std::shared_ptr< HTTPHeaders > trailers))
 
void onTrailers (std::unique_ptr< HTTPHeaders > trailers) noexceptoverride
 
 GMOCK_METHOD0_ (, noexcept,, onEOM, void())
 
 GMOCK_METHOD1_ (, noexcept,, onUpgrade, void(UpgradeProtocol))
 
 GMOCK_METHOD1_ (, noexcept,, onError, void(const HTTPException &))
 
void nextOnHeadersCompletePublic (std::shared_ptr< HTTPMessage > msg)
 
const std::stringgetFilterName () noexceptoverride
 
std::unique_ptr< HTTPMessageFilterclone () noexceptoverride
 
void nextOnEOMPublic ()
 
- Public Member Functions inherited from proxygen::HTTPMessageFilter
void setNextTransactionHandler (HTTPTransaction::Handler *next)
 
HTTPTransaction::HandlergetNextTransactionHandler ()
 
void onChunkHeader (size_t length) noexceptoverride
 
void onChunkComplete () noexceptoverride
 
void onEOM () noexceptoverride
 
void onUpgrade (UpgradeProtocol protocol) noexceptoverride
 
void onError (const HTTPException &error) noexceptoverride
 
void setTransaction (HTTPTransaction *txn) noexceptfinal
 
void detachTransaction () noexceptfinal
 
void onEgressPaused () noexceptfinal
 
void onEgressResumed () noexceptfinal
 
void onPushedTransaction (HTTPTransaction *txn) noexceptfinal
 
void onExTransaction (HTTPTransaction *txn) noexceptfinal
 
- Public Member Functions inherited from proxygen::HTTPTransactionHandler
virtual void onGoaway (ErrorCode) noexcept
 
virtual ~HTTPTransactionHandler ()
 
- Public Member Functions inherited from folly::DestructorCheck
virtual ~DestructorCheck ()
 

Additional Inherited Members

- Protected Member Functions inherited from proxygen::HTTPMessageFilter
void nextOnHeadersComplete (std::unique_ptr< HTTPMessage > msg)
 
void nextOnBody (std::unique_ptr< folly::IOBuf > chain)
 
void nextOnChunkHeader (size_t length)
 
void nextOnChunkComplete ()
 
void nextOnTrailers (std::unique_ptr< HTTPHeaders > trailers)
 
void nextOnEOM ()
 
void nextOnError (const HTTPException &ex)
 
- Protected Attributes inherited from proxygen::HTTPMessageFilter
HTTPTransaction::HandlernextTransactionHandler_ {nullptr}
 

Detailed Description

Definition at line 18 of file MockHTTPMessageFilter.h.

Member Function Documentation

std::unique_ptr<HTTPMessageFilter> proxygen::MockHTTPMessageFilter::clone ( )
inlineoverridevirtualnoexcept

Implements proxygen::HTTPMessageFilter.

Definition at line 50 of file MockHTTPMessageFilter.h.

References getFilterName().

50  {
51  LOG(FATAL) << "clone() not implemented for filter: "
52  << this->getFilterName();
53  };
const std::string & getFilterName() noexceptoverride
const std::string& proxygen::MockHTTPMessageFilter::getFilterName ( )
inlineoverridevirtualnoexcept

Reimplemented from proxygen::HTTPMessageFilter.

Definition at line 46 of file MockHTTPMessageFilter.h.

References proxygen::kMockFilterName.

Referenced by clone().

46  {
47  return kMockFilterName;
48  }
static const std::string kMockFilterName
proxygen::MockHTTPMessageFilter::GMOCK_METHOD0_ ( noexcept  ,
onChunkComplete  ,
void()   
)

Referenced by onBody(), and onTrailers().

proxygen::MockHTTPMessageFilter::GMOCK_METHOD0_ ( noexcept  ,
onEOM  ,
void()   
)
proxygen::MockHTTPMessageFilter::GMOCK_METHOD1_ ( noexcept  ,
onHeadersComplete  ,
void(std::shared_ptr< HTTPMessage >)   
)
proxygen::MockHTTPMessageFilter::GMOCK_METHOD1_ ( noexcept  ,
onBody  ,
void(std::shared_ptr< folly::IOBuf >)   
)
proxygen::MockHTTPMessageFilter::GMOCK_METHOD1_ ( noexcept  ,
onChunkHeader  ,
void(size_t)   
)
proxygen::MockHTTPMessageFilter::GMOCK_METHOD1_ ( noexcept  ,
onTrailers  ,
void(std::shared_ptr< HTTPHeaders > trailers)   
)
proxygen::MockHTTPMessageFilter::GMOCK_METHOD1_ ( noexcept  ,
onUpgrade  ,
void(UpgradeProtocol  
)
proxygen::MockHTTPMessageFilter::GMOCK_METHOD1_ ( noexcept  ,
onError  ,
void(const HTTPException &)   
)
void proxygen::MockHTTPMessageFilter::nextOnEOMPublic ( )
inline

Definition at line 55 of file MockHTTPMessageFilter.h.

References proxygen::HTTPMessageFilter::nextOnEOM().

55  {
56  nextOnEOM();
57  }
void proxygen::MockHTTPMessageFilter::nextOnHeadersCompletePublic ( std::shared_ptr< HTTPMessage msg)
inline

Definition at line 41 of file MockHTTPMessageFilter.h.

References folly::gen::move, and proxygen::HTTPMessageFilter::nextOnHeadersComplete().

41  {
42  std::unique_ptr<HTTPMessage> msgU(new HTTPMessage(*msg));
44  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
void nextOnHeadersComplete(std::unique_ptr< HTTPMessage > msg)
void proxygen::MockHTTPMessageFilter::onBody ( std::unique_ptr< folly::IOBuf chain)
inlineoverridevirtualnoexcept

Can be called multiple times per transaction. If you had previously called pauseIngress(), this callback will be delayed until you call resumeIngress().

Reimplemented from proxygen::HTTPMessageFilter.

Definition at line 27 of file MockHTTPMessageFilter.h.

References GMOCK_METHOD0_(), GMOCK_METHOD1_(), folly::pushmi::__adl::noexcept(), proxygen::HTTPMessageFilter::onChunkComplete(), proxygen::HTTPMessageFilter::onChunkHeader(), and onTrailers().

Referenced by onHeadersComplete().

27  {
28  onBody(std::shared_ptr<folly::IOBuf>(chain.release()));
29  }
void onBody(std::unique_ptr< folly::IOBuf > chain) noexceptoverride
void proxygen::MockHTTPMessageFilter::onHeadersComplete ( std::unique_ptr< HTTPMessage msg)
inlineoverridevirtualnoexcept

Called at most once per transaction. This is usually the first ingress callback. It is possible to get a read error before this however. If you had previously called pauseIngress(), this callback will be delayed until you call resumeIngress().

Reimplemented from proxygen::HTTPMessageFilter.

Definition at line 22 of file MockHTTPMessageFilter.h.

References GMOCK_METHOD1_(), folly::pushmi::__adl::noexcept(), and onBody().

22  {
23  onHeadersComplete(std::shared_ptr<HTTPMessage>(msg.release()));
24  }
void onHeadersComplete(std::unique_ptr< HTTPMessage > msg) noexceptoverride
void proxygen::MockHTTPMessageFilter::onTrailers ( std::unique_ptr< HTTPHeaders trailers)
inlineoverridevirtualnoexcept

Can be called any number of times per transaction. If you had previously called pauseIngress(), this callback will be delayed until you call resumeIngress(). Trailers can be received once right before the EOM of a chunked HTTP/1.1 reponse or multiple times per transaction from SPDY and HTTP/2.0 HEADERS frames.

Reimplemented from proxygen::HTTPMessageFilter.

Definition at line 34 of file MockHTTPMessageFilter.h.

References GMOCK_METHOD0_(), GMOCK_METHOD1_(), folly::pushmi::__adl::noexcept(), proxygen::HTTPMessageFilter::onEOM(), proxygen::HTTPMessageFilter::onError(), and proxygen::HTTPMessageFilter::onUpgrade().

Referenced by onBody().

34  {
35  onTrailers(std::shared_ptr<HTTPHeaders>(trailers.release()));
36  }
void onTrailers(std::unique_ptr< HTTPHeaders > trailers) noexceptoverride

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