18#ifndef DETERMINISTICESPASYNCWEBSERVER_EDGE_FETCH_H
19#define DETERMINISTICESPASYNCWEBSERVER_EDGE_FETCH_H
23#if DETWS_ENABLE_EDGE_CACHE
29struct EdgeFetchTransport
31 int (*open)(
void *ctx,
const char *host, uint16_t port, uint32_t timeout_ms);
32 bool (*send)(
void *ctx,
int cid,
const void *data,
size_t len);
33 size_t (*read)(
void *ctx,
int cid, uint8_t *buf,
size_t cap);
34 bool (*closed)(
void *ctx,
int cid);
35 void (*close)(
void *ctx,
int cid);
40enum class EdgeFetchStatus : uint8_t
57 size_t body_off, body_len;
62void edge_fetch_begin(EdgeFetch *f,
const EdgeFetchTransport *t,
const char *host, uint16_t port,
const void *request,
63 size_t req_len, uint32_t now_ms);
69EdgeFetchStatus edge_fetch_pump(EdgeFetch *f,
const EdgeFetchTransport *t, uint32_t now_ms);
72void edge_fetch_end(EdgeFetch *f,
const EdgeFetchTransport *t);
79bool edge_resp_complete(
const uint8_t *buf,
size_t len,
bool conn_closed,
size_t *head_len);
User-facing configuration for DeterministicESPAsyncWebServer.
#define DETWS_EDGE_FETCH_BUF