CCF
Loading...
Searching...
No Matches
include
ccf
app_interface.h
Go to the documentation of this file.
1
// Copyright (c) Microsoft Corporation. All rights reserved.
2
// Licensed under the Apache 2.0 License.
3
#pragma once
4
5
#include "
ccf/ccf_deprecated.h
"
6
#include "
ccf/common_endpoint_registry.h
"
7
#include "
ccf/js_plugin.h
"
8
#include "
ccf/node_context.h
"
9
10
#include <memory>
11
#include <vector>
12
13
// Forward declarations, can be removed with deprecation
14
namespace
ccf
15
{
16
class
RpcFrontend
;
17
}
18
19
namespace
ccf::kv
20
{
21
class
Store
;
22
}
23
24
namespace
ccf
25
{
26
class
UserEndpointRegistry
:
public
CommonEndpointRegistry
27
{
28
public
:
29
UserEndpointRegistry
(
ccf::AbstractNodeContext
&
context
);
30
31
// Default behaviour is to do nothing - do NOT log summary of every request
32
// as it completes. Apps may override this if they wish.
33
void
handle_event_request_completed
(
34
const
ccf::endpoints::RequestCompletedEvent
& event)
override
;
35
36
// Default behavour is to log dispatch failures, as a coarse metric of
37
// some user errors, but do not log the raw path, which may contain
38
// confidential fields misformatted into the wrong url
39
void
handle_event_dispatch_failed
(
40
const
ccf::endpoints::DispatchFailedEvent
& event)
override
;
41
};
42
}
43
44
namespace
ccf
45
{
46
// SNIPPET_START: app_interface
54
std::unique_ptr<ccf::endpoints::EndpointRegistry>
make_user_endpoints
(
55
ccf::AbstractNodeContext
& context);
56
61
std::vector<ccf::js::FFIPlugin>
get_js_plugins
();
62
// SNIPPET_END: app_interface
63
}
ccf_deprecated.h
ccf::BaseEndpointRegistry::context
ccf::AbstractNodeContext & context
Definition
base_endpoint_registry.h:123
ccf::CommonEndpointRegistry
Definition
common_endpoint_registry.h:16
ccf::RpcFrontend
Definition
frontend.h:36
ccf::UserEndpointRegistry
Definition
app_interface.h:27
ccf::UserEndpointRegistry::handle_event_dispatch_failed
void handle_event_dispatch_failed(const ccf::endpoints::DispatchFailedEvent &event) override
Definition
user_endpoint_registry.cpp:18
ccf::UserEndpointRegistry::handle_event_request_completed
void handle_event_request_completed(const ccf::endpoints::RequestCompletedEvent &event) override
Definition
user_endpoint_registry.cpp:14
ccf::kv::Store
Definition
store.h:87
common_endpoint_registry.h
js_plugin.h
ccf::kv
Definition
app_interface.h:20
ccf
Definition
app_interface.h:15
ccf::get_js_plugins
std::vector< ccf::js::FFIPlugin > get_js_plugins()
ccf::make_user_endpoints
std::unique_ptr< ccf::endpoints::EndpointRegistry > make_user_endpoints(ccf::AbstractNodeContext &context)
Definition
js_generic.cpp:8
node_context.h
ccf::AbstractNodeContext
Definition
node_context.h:12
ccf::endpoints::DispatchFailedEvent
Definition
endpoint_registry.h:55
ccf::endpoints::RequestCompletedEvent
Definition
endpoint_registry.h:42
Generated by
1.9.8