Fastly Compute C++ SDK
Loading...
Searching...
No Matches
fastly::esi::Processor Class Reference

#include <esi.h>

Public Member Functions

 Processor (std::optional< Request > original_request_metadata=std::nullopt, Configuration config=Configuration())
 Create a new ESI processor with the given configuration.
fastly::expected< void > process_response (Response &src_document, std::optional< Response > client_response_metadata=std::nullopt, std::optional< DispatchFragmentRequestFn > dispatch_fragment_request=std::nullopt, std::optional< ProcessFragmentResponseFn > process_fragment_response=std::nullopt)
fastly::expected< std::string > process_document (const std::string &src_document, std::optional< DispatchFragmentRequestFn > dispatch_fragment_request=std::nullopt, std::optional< ProcessFragmentResponseFn > process_fragment_response=std::nullopt)

Detailed Description

An ESI processor that can process a response containing ESI tags, dispatch requests for fragments, and process the fragment responses.

Examples
esi.cpp.

Constructor & Destructor Documentation

◆ Processor()

fastly::esi::Processor::Processor ( std::optional< Request > original_request_metadata = std::nullopt,
Configuration config = Configuration() )

Create a new ESI processor with the given configuration.

Member Function Documentation

◆ process_document()

fastly::expected< std::string > fastly::esi::Processor::process_document ( const std::string & src_document,
std::optional< DispatchFragmentRequestFn > dispatch_fragment_request = std::nullopt,
std::optional< ProcessFragmentResponseFn > process_fragment_response = std::nullopt )

Process a string containing ESI tags, optionally using the given callbacks to dispatch requests for fragments and process the fragment responses.

Parameters
src_documentThe string containing ESI tags to process.
dispatch_fragment_requestOptional callback to dispatch requests for fragments.
process_fragment_responseOptional callback to process fragment responses.

◆ process_response()

fastly::expected< void > fastly::esi::Processor::process_response ( Response & src_document,
std::optional< Response > client_response_metadata = std::nullopt,
std::optional< DispatchFragmentRequestFn > dispatch_fragment_request = std::nullopt,
std::optional< ProcessFragmentResponseFn > process_fragment_response = std::nullopt )

Process a response containing ESI tags, optionally using the given callbacks to dispatch requests for fragments and process the fragment responses.

Parameters
src_documentThe response containing ESI tags to process.
client_response_metadataOptional original client request data used for fragment requests.
dispatch_fragment_requestOptional callback to dispatch requests for fragments.
process_fragment_responseOptional callback to process fragment responses.
Examples
esi.cpp.

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