CCF
|
Namespaces | |
namespace | Tables |
Classes | |
struct | CommandEndpointContext |
struct | DispatchFailedEvent |
struct | Endpoint |
struct | EndpointContext |
struct | EndpointDefinition |
struct | EndpointKey |
struct | EndpointProperties |
class | EndpointRegistry |
struct | InterpreterReusePolicy |
struct | PathTemplatedEndpoint |
struct | PathTemplateSpec |
struct | ReadOnlyEndpointContext |
struct | RequestCompletedEvent |
Typedefs | |
using | URI = std::string |
using | EndpointDefinitionPtr = std::shared_ptr< const EndpointDefinition > |
using | EndpointsMap = ccf::ServiceMap< EndpointKey, EndpointProperties > |
using | EndpointPtr = std::shared_ptr< const Endpoint > |
using | CommandEndpointFunction = std::function< void(CommandEndpointContext &args)> |
using | EndpointFunction = std::function< void(EndpointContext &args)> |
using | LocallyCommittedEndpointFunction = std::function< void(CommandEndpointContext &ctx, const ccf::TxID &txid)> |
using | ReadOnlyEndpointFunction = std::function< void(ReadOnlyEndpointContext &args)> |
Enumerations | |
enum class | ForwardingRequired { Sometimes , Always , Never } |
enum class | RedirectionStrategy { None , ToPrimary , ToBackup } |
enum class | Mode { ReadWrite , ReadOnly , Historical } |
enum | QueryParamPresence { RequiredParameter , OptionalParameter } |
Functions | |
DECLARE_JSON_TYPE (EndpointKey) | |
DECLARE_JSON_REQUIRED_FIELDS (EndpointKey, uri_path, verb) | |
DECLARE_JSON_ENUM (ForwardingRequired, {{ForwardingRequired::Sometimes, "sometimes"}, {ForwardingRequired::Always, "always"}, {ForwardingRequired::Never, "never"}}) | |
DECLARE_JSON_ENUM (RedirectionStrategy, {{RedirectionStrategy::None, "none"}, {RedirectionStrategy::ToPrimary, "to_primary"}, {RedirectionStrategy::ToBackup, "to_backup"}}) | |
DECLARE_JSON_ENUM (Mode, {{Mode::ReadWrite, "readwrite"}, {Mode::ReadOnly, "readonly"}, {Mode::Historical, "historical"}}) | |
void | to_json (nlohmann::json &j, const InterpreterReusePolicy &grp) |
void | from_json (const nlohmann::json &j, InterpreterReusePolicy &grp) |
std::string | schema_name (const InterpreterReusePolicy *) |
void | fill_json_schema (nlohmann::json &schema, const InterpreterReusePolicy *) |
DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS (EndpointProperties) | |
DECLARE_JSON_REQUIRED_FIELDS (EndpointProperties, forwarding_required, authn_policies) | |
DECLARE_JSON_OPTIONAL_FIELDS (EndpointProperties, openapi, openapi_hidden, mode, js_module, js_function, interpreter_reuse, redirection_strategy) | |
void | default_locally_committed_func (CommandEndpointContext &ctx, const TxID &tx_id) |
template<typename T > | |
bool | get_path_param (const ccf::PathParams ¶ms, const std::string ¶m_name, T &value, std::string &error) |
template<> | |
bool | get_path_param (const ccf::PathParams ¶ms, const std::string ¶m_name, std::string &value, std::string &error) |
std::string | camel_case (std::string s, bool camel_first=true, const std::string &separator_regex="[^[:alnum:]]") |
Defines the different types of context an Endpoint can operate over, and the types of handler functions which process them.
using ccf::endpoints::CommandEndpointFunction = typedef std::function<void(CommandEndpointContext& args)> |
using ccf::endpoints::EndpointDefinitionPtr = typedef std::shared_ptr<const EndpointDefinition> |
using ccf::endpoints::EndpointFunction = typedef std::function<void(EndpointContext& args)> |
using ccf::endpoints::EndpointPtr = typedef std::shared_ptr<const Endpoint> |
using ccf::endpoints::EndpointsMap = typedef ccf::ServiceMap<EndpointKey, EndpointProperties> |
using ccf::endpoints::LocallyCommittedEndpointFunction = typedef std::function<void(CommandEndpointContext& ctx, const ccf::TxID& txid)> |
using ccf::endpoints::ReadOnlyEndpointFunction = typedef std::function<void(ReadOnlyEndpointContext& args)> |
using ccf::endpoints::URI = typedef std::string |
|
strong |
Enumerator | |
---|---|
Sometimes | ForwardingRequired::Sometimes is the default value, and should be used for most read-only operations. If this request is made to a backup node, it may be forwarded to the primary node for execution to maintain session consistency. Specifically, if this request is sent as part of a session which was already forwarded, then it will also be forwarded. |
Always | ForwardingRequired::Always should be used for operations which may produce writes. If this request is made to a backup node, it will be forwarded to the primary node for execution. |
Never | ForwardingRequired::Never should be used for operations which want to read node-local state rather than the latest replicated state, such as historical queries or local consensus information. This call will never be forwarded, and is always executed on the receiving node, potentiall breaking session consistency. If this attempts to write on a backup, this will fail. |
|
strong |
|
strong |
std::string ccf::endpoints::camel_case | ( | std::string | s, |
bool | camel_first = true , |
||
const std::string & | separator_regex = "[^[:alnum:]]" |
||
) |
ccf::endpoints::DECLARE_JSON_ENUM | ( | ForwardingRequired | , |
{{ForwardingRequired::Sometimes, "sometimes"}, {ForwardingRequired::Always, "always"}, {ForwardingRequired::Never, "never"}} | |||
) |
ccf::endpoints::DECLARE_JSON_ENUM | ( | Mode | , |
{{Mode::ReadWrite, "readwrite"}, {Mode::ReadOnly, "readonly"}, {Mode::Historical, "historical"}} | |||
) |
ccf::endpoints::DECLARE_JSON_ENUM | ( | RedirectionStrategy | , |
{{RedirectionStrategy::None, "none"}, {RedirectionStrategy::ToPrimary, "to_primary"}, {RedirectionStrategy::ToBackup, "to_backup"}} | |||
) |
ccf::endpoints::DECLARE_JSON_OPTIONAL_FIELDS | ( | EndpointProperties | , |
openapi | , | ||
openapi_hidden | , | ||
mode | , | ||
js_module | , | ||
js_function | , | ||
interpreter_reuse | , | ||
redirection_strategy | |||
) |
ccf::endpoints::DECLARE_JSON_REQUIRED_FIELDS | ( | EndpointKey | , |
uri_path | , | ||
verb | |||
) |
ccf::endpoints::DECLARE_JSON_REQUIRED_FIELDS | ( | EndpointProperties | , |
forwarding_required | , | ||
authn_policies | |||
) |
ccf::endpoints::DECLARE_JSON_TYPE | ( | EndpointKey | ) |
ccf::endpoints::DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS | ( | EndpointProperties | ) |
void ccf::endpoints::default_locally_committed_func | ( | CommandEndpointContext & | ctx, |
const TxID & | tx_id | ||
) |
void ccf::endpoints::fill_json_schema | ( | nlohmann::json & | schema, |
const InterpreterReusePolicy * | policy | ||
) |
void ccf::endpoints::from_json | ( | const nlohmann::json & | j, |
InterpreterReusePolicy & | grp | ||
) |
|
inline |
|
inline |
std::string ccf::endpoints::schema_name | ( | const InterpreterReusePolicy * | policy | ) |
void ccf::endpoints::to_json | ( | nlohmann::json & | j, |
const InterpreterReusePolicy & | grp | ||
) |