C++ edjLibrary SDK
|
This SDK is used to develop EDJX serverless functions. In this version, only HTTP trigger functions are supported. That is, functions can be triggered using HTTP only.
These functions are triggered from standard HTTP methods. The input for the function is an HTTP request object (represented by edjx::request::HttpRequest
in the EDJX SDK) and the return value has to be an HTTP response object (represented by edjx::response::HttpResponse
in the EDJX SDK).
EDJX sample C++ Serverless Application has two C++ files:
lib.cpp
serverless_function.cpp
This file contains helper code to fetch HTTP requests and pass the request as input to the serverless function. Additionally, this file has code related to HTTP response processing. Modify this file only when the HTTP body prefetch needs to be disabled for HTTP request, or the HTTP response type needs to be changed. See edjx::request::HttpRequest
and edjx::response::HttpResponse
for more details.
This file contains the code to create a Serverless Function.
The edjx::request::HttpRequest
reference to the argument is read-only, that is, it has only methods to read a received HTTP request.
Two other important types in the API are edjx::fetch::HttpFetch
and edjx::fetch::FetchResponse
. HttpFetch
is used to execute HTTP requests. FetchResponse
is returned as a response for the fetch HTTP request.
Currently, all HTTP APIs have a size limit of 512 MB for the HTTP body.
The most important APIs in the EDJX Library SDK are those used to interact with the Object Storage (represented by edjx::storage
namespace in the EDJX SDK) and the KV Store (represented by edjx::kv
namespace in the EDJX SDK).
The Object Store is a decentralized datastore backed by the EDJX P2P network. This SDK has GET and PUT methods to be used for file contents and associated attributes.
The KV Store is a decentralized Key-Value datastore backed by the EDJX P2P network. There are specific limits on the size of Key and Value. Key size is limited to 512 bytes and Value is limited to 512 KB.
This API provides functions to log std::string
messages.