Audacity 3.2.0
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
audacity::sentry::SentryRequestBuilder Class Referencefinal

A helper, that creates a correct Request to Sentry. More...

#include <SentryRequestBuilder.h>

Collaboration diagram for audacity::sentry::SentryRequestBuilder:
[legend]

Public Member Functions

network_manager::Request CreateRequest () const
 

Static Public Member Functions

static const SentryRequestBuilderGet ()
 

Private Member Functions

 SentryRequestBuilder ()
 

Private Attributes

std::string mUrl
 

Detailed Description

A helper, that creates a correct Request to Sentry.

Definition at line 23 of file SentryRequestBuilder.h.

Constructor & Destructor Documentation

◆ SentryRequestBuilder()

audacity::sentry::SentryRequestBuilder::SentryRequestBuilder ( )
private

Definition at line 46 of file SentryRequestBuilder.cpp.

47{
48 mUrl = std::string("https://") + SENTRY_DSN_KEY + "@" + SENTRY_HOST +
49 "/api/" + SENTRY_PROJECT + "/store/";
50}

References mUrl.

Member Function Documentation

◆ CreateRequest()

network_manager::Request audacity::sentry::SentryRequestBuilder::CreateRequest ( ) const

Definition at line 27 of file SentryRequestBuilder.cpp.

28{
29 using namespace std::chrono;
30
31 const std::string sentryAuth =
32 std::string("Sentry sentry_version=7,sentry_timestamp=") +
33 std::to_string(
34 duration_cast<seconds>(system_clock::now().time_since_epoch())
35 .count()) +
36 ",sentry_client=sentry-audacity/1.0,sentry_key=" + SENTRY_DSN_KEY;
37
38 network_manager::Request request(mUrl);
39
40 request.setHeader("Content-Type", "application/json");
41 request.setHeader("X-Sentry-Auth", sentryAuth);
42
43 return request;
44}

References mUrl, and audacity::network_manager::Request::setHeader().

Referenced by audacity::sentry::Report::ReportImpl::Send().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Get()

const SentryRequestBuilder & audacity::sentry::SentryRequestBuilder::Get ( )
static

Definition at line 20 of file SentryRequestBuilder.cpp.

21{
22 static SentryRequestBuilder builder;
23
24 return builder;
25}

Referenced by audacity::sentry::Report::ReportImpl::Send().

Here is the caller graph for this function:

Member Data Documentation

◆ mUrl

std::string audacity::sentry::SentryRequestBuilder::mUrl
private

Definition at line 33 of file SentryRequestBuilder.h.

Referenced by CreateRequest(), and SentryRequestBuilder().


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