cwist
Modern C web framework with libttak runtime
Loading...
Searching...
No Matches
cwist_app Struct Reference

Main Application Context. More...

#include <app.h>

Collaboration diagram for cwist_app:

Public Attributes

int port
 
bool use_ssl
 
bool use_http2
 Cleartext HTTP/2 (h2c)
 
bool use_http3
 Ephemeral (Zero-config) HTTP/3.
 
bool use_https2
 TLS HTTP/2 (h2)
 
bool use_https3
 TLS HTTP/3.
 
char * cert_path
 
char * key_path
 
cwist_https_request_handler_func https_request_handler
 
cwist_middleware_node * middlewares
 Head of the middleware chain.
 
cwist_route_table * router
 Router definition.
 
cwist_static_dir * static_dirs
 Static directory mappings.
 
cwist_error_handler_func error_handler
 Global fallback error handler.
 
cwist_error_handler_entry * error_handlers
 Per-status-code error handlers.
 
struct cwist_config * config
 Application configuration.
 
struct cwist_logger * logger
 Application logger.
 
cwist_https_context * ssl_ctx
 SSL context when TLS is enabled.
 
struct cwist_http3_context * h3_ctx
 HTTP/3 QUIC Context.
 
cwist_db * db
 Shared database handle.
 
char * db_path
 Database path (if set).
 
bool nuke_enabled
 True when NUKE DB integration is active.
 
size_t max_mem_space
 Max memory space for static file pool (0 = auto-detected * 2)
 
struct cwist_fix_server_mem * mem_manager
 Memory manager for static asset caching and hot-reloading.
 
cwist_bdr_t * bdr_ctx
 Legacy standalone BDR storage; never replayed by HTTP dispatch.
 
struct cwist_rdbms_runtime * rdbms
 Mounted RDBMS runtime (auto-detected PostgreSQL/MySQL/MariaDB)
 
bool pqc_layer_enabled
 PQC Layer enabled flag.
 
char * tls_groups
 Explicit TLS groups override (NULL = automatic)
 
cwist_webtransport_handler_func wt_handler
 WebTransport session handler.
 
char * session_secret
 Session signing secret (HMAC-SHA256).
 
char * session_name
 Session cookie name.
 
int session_max_age
 Session cookie max-age in seconds.
 
void * db_pool
 Database connection pool (when enabled).
 
void * redis_pool
 Redis connection pool (when enabled).
 
void * scheduler
 Background job scheduler (when enabled).
 
void * grpc_routes
 Unary gRPC route registry.
 
void * assets
 Content-hashed in-memory assets (see <cwist/sys/app/assets.h>).
 

Detailed Description

Main Application Context.

Manages routing, middleware, database connections, memory pools, and caching strategies (BDR).

Definition at line 155 of file app.h.

Member Data Documentation

◆ assets

void* cwist_app::assets

Content-hashed in-memory assets (see <cwist/sys/app/assets.h>).

Definition at line 222 of file app.h.

Referenced by cwist_app_destroy(), and cwist_assets_match().

◆ bdr_ctx

cwist_bdr_t* cwist_app::bdr_ctx

Legacy standalone BDR storage; never replayed by HTTP dispatch.

Definition at line 189 of file app.h.

Referenced by cwist_app_configure_bdr(), cwist_app_create(), cwist_app_destroy(), and cwist_app_http_handler().

◆ cert_path

◆ config

struct cwist_config* cwist_app::config

Application configuration.

Definition at line 174 of file app.h.

Referenced by cwist_app_create(), and cwist_app_destroy().

◆ db

◆ db_path

char* cwist_app::db_path

Database path (if set).

Definition at line 180 of file app.h.

Referenced by cwist_app_create(), cwist_app_destroy(), cwist_app_use_db(), and cwist_app_use_nuke_db().

◆ db_pool

void* cwist_app::db_pool

Database connection pool (when enabled).

Definition at line 210 of file app.h.

Referenced by cwist_app_create(), cwist_app_destroy(), cwist_app_get_db_pool(), and cwist_app_use_db_pool().

◆ error_handler

cwist_error_handler_func cwist_app::error_handler

Global fallback error handler.

Definition at line 171 of file app.h.

Referenced by cwist_app_create(), and cwist_app_set_error_handler().

◆ error_handlers

cwist_error_handler_entry* cwist_app::error_handlers

Per-status-code error handlers.

Definition at line 172 of file app.h.

Referenced by cwist_app_create(), cwist_app_destroy(), and cwist_app_register_error_handler().

◆ grpc_routes

void* cwist_app::grpc_routes

Unary gRPC route registry.

Definition at line 219 of file app.h.

Referenced by cwist_app_create(), cwist_grpc_routes_clone(), and cwist_grpc_routes_destroy().

◆ h3_ctx

struct cwist_http3_context* cwist_app::h3_ctx

HTTP/3 QUIC Context.

Definition at line 178 of file app.h.

Referenced by cwist_app_create(), cwist_app_destroy(), cwist_app_reload_tls(), and cwist_app_use_webtransport().

◆ https_request_handler

cwist_https_request_handler_func cwist_app::https_request_handler

Definition at line 164 of file app.h.

Referenced by cwist_app_create().

◆ key_path

◆ logger

struct cwist_logger* cwist_app::logger

Application logger.

Definition at line 175 of file app.h.

Referenced by cwist_app_create(), and cwist_app_destroy().

◆ max_mem_space

size_t cwist_app::max_mem_space

Max memory space for static file pool (0 = auto-detected * 2)

Definition at line 184 of file app.h.

Referenced by cwist_app_create(), and cwist_app_set_max_memspace().

◆ mem_manager

struct cwist_fix_server_mem* cwist_app::mem_manager

Memory manager for static asset caching and hot-reloading.

Definition at line 186 of file app.h.

Referenced by cwist_app_create(), and cwist_app_destroy().

◆ middlewares

cwist_middleware_node* cwist_app::middlewares

Head of the middleware chain.

Definition at line 166 of file app.h.

Referenced by cwist_app_create(), and cwist_app_destroy().

◆ nuke_enabled

bool cwist_app::nuke_enabled

True when NUKE DB integration is active.

Definition at line 181 of file app.h.

Referenced by cwist_app_create(), cwist_app_destroy(), cwist_app_get_db(), cwist_app_use_db(), and cwist_app_use_nuke_db().

◆ port

int cwist_app::port

Definition at line 156 of file app.h.

Referenced by cwist_app_create(), and cwist_app_listen_ex().

◆ pqc_layer_enabled

bool cwist_app::pqc_layer_enabled

PQC Layer enabled flag.

Definition at line 195 of file app.h.

Referenced by cwist_app_create(), cwist_app_use_pqc_layer(), and cwist_tls_apply_pqc_layer().

◆ rdbms

struct cwist_rdbms_runtime* cwist_app::rdbms

Mounted RDBMS runtime (auto-detected PostgreSQL/MySQL/MariaDB)

Definition at line 192 of file app.h.

Referenced by cwist_app_destroy(), and cwist_rdbms_mount_runtime().

◆ redis_pool

void* cwist_app::redis_pool

Redis connection pool (when enabled).

Definition at line 213 of file app.h.

Referenced by cwist_app_create(), cwist_app_destroy(), cwist_app_get_redis_pool(), and cwist_app_use_redis().

◆ router

cwist_route_table* cwist_app::router

Router definition.

Definition at line 168 of file app.h.

Referenced by cwist_app_create(), cwist_app_destroy(), cwist_app_ws(), cwist_app_ws_async(), cwist_app_ws_opt(), and cwist_url_for().

◆ scheduler

void* cwist_app::scheduler

Background job scheduler (when enabled).

Definition at line 216 of file app.h.

Referenced by cwist_app_create(), cwist_app_destroy(), cwist_app_get_scheduler(), and cwist_app_use_scheduler().

◆ session_max_age

int cwist_app::session_max_age

Session cookie max-age in seconds.

Definition at line 207 of file app.h.

Referenced by cwist_app_create(), cwist_app_set_session_max_age(), and cwist_app_use_session().

◆ session_name

char* cwist_app::session_name

Session cookie name.

Definition at line 205 of file app.h.

Referenced by cwist_app_create(), cwist_app_destroy(), cwist_app_set_session_name(), cwist_app_use_session(), and cwist_session_start().

◆ session_secret

char* cwist_app::session_secret

Session signing secret (HMAC-SHA256).

Definition at line 203 of file app.h.

Referenced by cwist_app_create(), cwist_app_destroy(), cwist_app_use_session(), cwist_mw_session(), and cwist_session_start().

◆ ssl_ctx

cwist_https_context* cwist_app::ssl_ctx

SSL context when TLS is enabled.

Definition at line 177 of file app.h.

Referenced by cwist_app_create(), cwist_app_destroy(), cwist_app_reload_tls(), and cwist_app_use_ech().

◆ static_dirs

cwist_static_dir* cwist_app::static_dirs

Static directory mappings.

Definition at line 169 of file app.h.

Referenced by cwist_app_create(), cwist_app_destroy(), cwist_app_static(), and cwist_app_static_with_cache().

◆ tls_groups

char* cwist_app::tls_groups

Explicit TLS groups override (NULL = automatic)

Definition at line 197 of file app.h.

Referenced by cwist_app_create(), cwist_app_destroy(), cwist_app_set_tls_groups(), and cwist_tls_apply_pqc_layer().

◆ use_http2

bool cwist_app::use_http2

Cleartext HTTP/2 (h2c)

Definition at line 158 of file app.h.

Referenced by cwist_app_create(), cwist_app_http_handler(), cwist_app_http_handler_async(), and cwist_app_use_http2().

◆ use_http3

bool cwist_app::use_http3

Ephemeral (Zero-config) HTTP/3.

Definition at line 159 of file app.h.

Referenced by cwist_app_create(), cwist_app_use_http3(), and cwist_app_use_https().

◆ use_https2

bool cwist_app::use_https2

TLS HTTP/2 (h2)

Definition at line 160 of file app.h.

Referenced by cwist_app_create(), and cwist_app_use_https2().

◆ use_https3

bool cwist_app::use_https3

TLS HTTP/3.

Definition at line 161 of file app.h.

Referenced by cwist_app_create(), cwist_app_reload_tls(), cwist_app_use_https(), and cwist_app_use_https3().

◆ use_ssl

bool cwist_app::use_ssl

◆ wt_handler

cwist_webtransport_handler_func cwist_app::wt_handler

WebTransport session handler.

Definition at line 200 of file app.h.

Referenced by cwist_app_create(), and cwist_app_use_webtransport().


The documentation for this struct was generated from the following file: