userver
C++ Async Framework
Toggle main menu visibility
Documentation
API Groups
Namespaces
Reference
Class List
Class Index
File List
Macros
All
e
i
l
r
t
u
Functions
Macros
e
i
l
r
t
u
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Concepts
Loading...
Searching...
No Matches
operations_encrypted.hpp
1
#
pragma
once
2
3
#
include
<
userver
/
utils
/
boost_filesystem_file_status
.
hpp
>
4
5
#
include
<
userver
/
dump
/
factory
.
hpp
>
6
#
include
<
userver
/
dump
/
operations
.
hpp
>
7
#
include
<
userver
/
utils
/
fast_pimpl
.
hpp
>
8
#
include
<
userver
/
utils
/
strong_typedef
.
hpp
>
9
10
USERVER_NAMESPACE_BEGIN
11
12
namespace
dump
{
13
14
using
SecretKey
=
utils
::
NonLoggable
<
class
SecretKeyTag, std::string>;
15
16
class
EncryptedWriter
final
:
public
Writer
{
17
public
:
18
/// @brief Creates a new dump file and opens it
19
/// @throws `Error` on a filesystem error
20
EncryptedWriter
(
21
std::string filename,
22
const
SecretKey& secret_key,
23
boost::filesystem::perms,
24
tracing
::
ScopeTime
& scope
25
);
26
27
~EncryptedWriter()
override
;
28
29
void
Finish
()
override
;
30
31
private
:
32
void
WriteRaw(std::string_view data)
override
;
33
34
struct
Impl;
35
utils
::FastPimpl<Impl, 632, 8> impl_;
36
};
16
class
EncryptedWriter
final
:
public
Writer
{
…
};
37
38
class
EncryptedReader
final
:
public
Reader
{
39
public
:
40
/// @brief Opens an existing dump file
41
/// @throws `Error` on a filesystem error
42
EncryptedReader
(std::string filename,
const
SecretKey& key);
43
44
~EncryptedReader()
override
;
45
46
void
Finish
()
override
;
47
48
private
:
49
std::string_view ReadRaw(std::size_t max_size)
override
;
50
51
void
BackUp(std::size_t size)
override
;
52
53
struct
Impl;
54
utils
::FastPimpl<Impl, 600, 8> impl_;
55
};
38
class
EncryptedReader
final
:
public
Reader
{
…
};
56
57
class
EncryptedOperationsFactory
final
:
public
OperationsFactory
{
58
public
:
59
EncryptedOperationsFactory(SecretKey&& secret_key, boost::filesystem::perms perms);
60
61
std::unique_ptr<
Reader
> CreateReader(std::string full_path)
override
;
62
63
std::unique_ptr<
Writer
> CreateWriter(std::string full_path,
tracing
::
ScopeTime
& scope)
override
;
64
65
private
:
66
const
SecretKey secret_key_;
67
const
boost::filesystem::perms perms_;
68
};
57
class
EncryptedOperationsFactory
final
:
public
OperationsFactory
{
…
};
69
70
}
// namespace dump
71
72
USERVER_NAMESPACE_END
userver
dump
operations_encrypted.hpp
Generated on Wed Apr 30 2025 15:52:45 for userver by
Doxygen
1.13.2