proxygen
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
HTTPErrorPage.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2015-present, Facebook, Inc.
3
* All rights reserved.
4
*
5
* This source code is licensed under the BSD-style license found in the
6
* LICENSE file in the root directory of this source tree. An additional grant
7
* of patent rights can be found in the PATENTS file in the same directory.
8
*
9
*/
10
#pragma once
11
12
#include <memory>
13
#include <string>
14
15
namespace
folly
{
16
class
IOBuf;
17
}
18
19
namespace
proxygen
{
20
25
class
HTTPErrorPage
{
26
public
:
27
struct
Page
{
28
Page
(
const
std::string
& pageContentType,
29
std::unique_ptr<folly::IOBuf> pageContent) :
30
contentType(pageContentType), content(
std
::
move
(pageContent)) {}
31
32
Page
(
Page
&& other)
noexcept
:
33
contentType(other.contentType),
34
content(
std
::
move
(other.content)) {
35
}
36
37
const
std::string
contentType
;
38
std::unique_ptr<folly::IOBuf>
content
;
39
};
40
41
virtual
~HTTPErrorPage
() {}
42
43
virtual
Page
generate(
uint64_t
requestID,
44
unsigned
httpStatusCode,
45
const
std::string
& reason,
46
std::unique_ptr<folly::IOBuf> body,
47
const
std::string
& detailReason)
const
= 0;
48
};
49
53
class
HTTPStaticErrorPage
:
public
HTTPErrorPage
{
54
public
:
55
explicit
HTTPStaticErrorPage
(
56
std::unique_ptr<folly::IOBuf> content,
57
const
std::string
& contentType =
"text/html; charset=utf-8"
);
58
59
Page
generate(
uint64_t
requestID,
60
unsigned
httpStatusCode,
61
const
std::string
& reason,
62
std::unique_ptr<folly::IOBuf> body,
63
const
std::string
& detailReason)
const override
;
64
65
private
:
66
std::unique_ptr<folly::IOBuf>
content_
;
67
std::string
contentType_
;
68
};
69
70
}
// proxygen
proxygen::HTTPErrorPage::~HTTPErrorPage
virtual ~HTTPErrorPage()
Definition:
HTTPErrorPage.h:41
proxygen::HTTPStaticErrorPage::content_
std::unique_ptr< folly::IOBuf > content_
Definition:
HTTPErrorPage.h:66
proxygen::HTTPErrorPage::Page::Page
Page(Page &&other) noexcept
Definition:
HTTPErrorPage.h:32
proxygen::HTTPErrorPage
Definition:
HTTPErrorPage.h:25
folly::gen::move
constexpr detail::Map< Move > move
Definition:
Base-inl.h:2567
std
STL namespace.
proxygen::HTTPErrorPage::Page
Definition:
HTTPErrorPage.h:27
folly
—— Concurrent Priority Queue Implementation ——
Definition:
AtomicBitSet.h:29
proxygen::HTTPErrorPage::Page::contentType
const std::string contentType
Definition:
HTTPErrorPage.h:37
folly::pushmi::__adl::noexcept
requires E e noexcept(noexcept(s.error(std::move(e))))
Definition:
extension_points.h:40
proxygen::HTTPStaticErrorPage
Definition:
HTTPErrorPage.h:53
string
const char * string
Definition:
Conv.cpp:212
uint64_t
uint64_t
Definition:
ConstexprMathBenchmark.cpp:190
proxygen
Definition:
ExMessageHandler.h:14
proxygen::HTTPStaticErrorPage::contentType_
std::string contentType_
Definition:
HTTPErrorPage.h:67
proxygen::HTTPErrorPage::Page::content
std::unique_ptr< folly::IOBuf > content
Definition:
HTTPErrorPage.h:38
proxygen::HTTPErrorPage::Page::Page
Page(const std::string &pageContentType, std::unique_ptr< folly::IOBuf > pageContent)
Definition:
HTTPErrorPage.h:28
proxygen
lib
http
session
HTTPErrorPage.h
Generated by
1.8.11