Cutelyst  1.7.0
Signals | Public Member Functions | Properties | List of all members
CWSGI::WSGI Class Reference

Implements a WSGI server. More...

#include <Cutelyst/WSGI>

Inheritance diagram for CWSGI::WSGI:
Inheritance graph
[legend]

Signals

void ready ()
 

Public Member Functions

 WSGI (QObject *parent=nullptr)
 
QString application () const
 
bool autoReload () const
 
int bufferSize () const
 
QString chdir () const
 
QString chdir2 () const
 
QString chownSocket () const
 
int cpuAffinity () const
 
int exec (Cutelyst::Application *app=nullptr)
 
QStringList fastcgiSocket () const
 
QString gid () const
 
QStringList httpSocket () const
 
QStringList httpsSocket () const
 
QStringList ini () const
 
QStringList json () const
 
bool lazy () const
 
bool master () const
 
bool noInitgroups () const
 
void parseCommandLine (const QStringList &args)
 
QString pidfile () const
 
QString pidfile2 () const
 
qint64 postBuffering () const
 
qint64 postBufferingBufsize () const
 
QString processes () const
 
void setApplication (const QString &application)
 
void setAutoReload (bool enable)
 
void setBufferSize (qint64 size)
 
void setChdir (const QString &chdir)
 
void setChdir2 (const QString &chdir2)
 
void setChownSocket (const QString &chownSocket)
 
void setCpuAffinity (int value)
 
void setFastcgiSocket (const QStringList &fastcgiSocket)
 
void setGid (const QString &gid)
 
void setHttpSocket (const QStringList &httpSocket)
 
void setHttpsSocket (const QStringList &httpsSocket)
 
void setIni (const QStringList &ini)
 
void setJson (const QStringList &files)
 
void setLazy (bool enable)
 
void setMaster (bool enable)
 
void setNoInitgroups (bool enable)
 
void setPidfile (const QString &file)
 
void setPidfile2 (const QString &file)
 
void setPostBuffering (qint64 size)
 
void setPostBufferingBufsize (qint64 size)
 
void setProcesses (const QString &process)
 
void setSocketAccess (const QString &socketAccess)
 
void setSocketRcvbuf (int value)
 
void setSocketSndbuf (int value)
 
void setSocketTimeout (int timeout)
 
void setSoKeepalive (bool enable)
 
void setStaticMap (const QStringList &staticMap)
 
void setStaticMap2 (const QStringList &staticMap)
 
void setTcpNodelay (bool enable)
 
void setThreads (const QString &threads)
 
void setTouchReload (const QStringList &files)
 
void setUid (const QString &uid)
 
void setUmask (const QString &value)
 
void setWebsocketMaxSize (int value)
 
QString socketAccess () const
 
int socketRcvbuf () const
 
int socketSndbuf () const
 
int socketTimeout () const
 
bool soKeepalive () const
 
QStringList staticMap () const
 
QStringList staticMap2 () const
 
bool tcpNodelay () const
 
QString threads () const
 
QStringList touchReload () const
 
QString uid () const
 
QString umask () const
 
int websocketMaxSize () const
 

Properties

QString application
 
bool auto_reload
 
qint64 buffer_size
 
QString chdir
 
QString chdir2
 
QString chown_socket
 
int cpu_affinity
 
QStringList fastcgi_socket
 
QString gid
 
QStringList http_socket
 
QStringList https_socket
 
QStringList ini
 
QStringList json
 
bool lazy
 
bool master
 
bool no_initgroups
 
QString pidfile
 
QString pidfile2
 
qint64 post_buffering
 
qint64 post_buffering_bufsize
 
QString processes
 
bool so_keepalive
 
QString socket_access
 
int socket_rcvbuf
 
int socket_sndbuf
 
int socket_timeout
 
QStringList static_map
 
QStringList static_map2
 
bool tcp_nodelay
 
QString threads
 
QStringList touch_reload
 
QString uid
 
QString umask
 
int websocket_max_size
 

Detailed Description

Definition at line 39 of file wsgi.h.

Member Function Documentation

int CWSGI::WSGI::exec ( Cutelyst::Application app = nullptr)

This function will start the WSGI server.

If an application is provided it will ignore the value of setApplication and/or the Application configuration in case Ini is set, meaning it won't dynamically load an Application but use this to create new instances (if the app constructor is marked as Q_INVOKABLE).

It will return 0 in case of sucess.

Note
This method calls QCoreApplication::exec() internally, this is needed because when creating or recreating child process the event loop must not be running otherwise we get undefined behavior. So exit main after this function.
void CWSGI::WSGI::ready ( )
signal

It is emitted once the server is ready.

Property Documentation

QString CWSGI::WSGI::application
readwrite

Defines application file path to be loaded, an alternative is to provide the Cutelyst::Application pointer to exec()

Accessors:
application(), setApplication()

Definition at line 72 of file wsgi.h.

bool CWSGI::WSGI::auto_reload
readwrite

Reload application if the application file is modified or touched

Accessors:
autoReload(), setAutoReload()

Definition at line 195 of file wsgi.h.

qint64 CWSGI::WSGI::buffer_size
readwrite

Defines the buffer size used when parsing requests

Accessors:
bufferSize(), setBufferSize()

Definition at line 211 of file wsgi.h.

QString CWSGI::WSGI::chdir
readwrite

Defines directory to chdir to before application loading

Accessors:
chdir(), setChdir()

Definition at line 98 of file wsgi.h.

QString CWSGI::WSGI::chdir2
readwrite

Defines directory to chdir to after application loading

Accessors:
chdir2(), setChdir2()

Definition at line 146 of file wsgi.h.

QString CWSGI::WSGI::chown_socket
readwrite

Defines owner of UNIX sockets.

Accessors:
chownSocket(), setChownSocket()

Definition at line 317 of file wsgi.h.

int CWSGI::WSGI::cpu_affinity
readwrite

Defines CPU affinity

Accessors:
cpuAffinity(), setCpuAffinity()

Definition at line 333 of file wsgi.h.

QStringList CWSGI::WSGI::fastcgi_socket
readwrite

Defines how an FastCGI socket should be binded

Accessors:
fastcgiSocket(), setFastcgiSocket()

Definition at line 122 of file wsgi.h.

QString CWSGI::WSGI::gid
readwrite

Defines group id of the process.

Accessors:
gid(), setGid()

Definition at line 301 of file wsgi.h.

QStringList CWSGI::WSGI::http_socket
readwrite

Defines how an HTTP socket should be binded

Accessors:
httpSocket(), setHttpSocket()

Definition at line 106 of file wsgi.h.

QStringList CWSGI::WSGI::https_socket
readwrite

Defines how an HTTPS socket should be binded

Accessors:
httpsSocket(), setHttpsSocket()

Definition at line 114 of file wsgi.h.

QStringList CWSGI::WSGI::ini
readwrite

Load config from ini file

Accessors:
ini(), setIni()

Definition at line 154 of file wsgi.h.

QStringList CWSGI::WSGI::json
readwrite

Load config from JSON file

Accessors:
json(), setJson()

Definition at line 162 of file wsgi.h.

bool CWSGI::WSGI::lazy
readwrite

Defines is the Application should be lazy loaded.

Accessors:
lazy(), setLazy()

Definition at line 352 of file wsgi.h.

bool CWSGI::WSGI::master
readwrite

Defines if a master process should be created to watch for it's child processes

Accessors:
master(), setMaster()

Definition at line 187 of file wsgi.h.

bool CWSGI::WSGI::no_initgroups
readwrite

Disable additional groups set via initgroups()

Accessors:
noInitgroups(), setNoInitgroups()

Definition at line 309 of file wsgi.h.

QString CWSGI::WSGI::pidfile
readwrite

Defines the pid file to be written before privileges drop

Accessors:
pidfile(), setPidfile()

Definition at line 276 of file wsgi.h.

QString CWSGI::WSGI::pidfile2
readwrite

Defines the pid file to be written before privileges drop

Accessors:
pidfile(), setPidfile()

Definition at line 284 of file wsgi.h.

qint64 CWSGI::WSGI::post_buffering
readwrite

Defines the maximum buffer size of POST request, if a request has a content length that is bigger than the post buffer size a temporary file is created instead

Accessors:
postBuffering(), setPostBuffering()

Definition at line 220 of file wsgi.h.

qint64 CWSGI::WSGI::post_buffering_bufsize
readwrite

Defines the buffer size when reading a POST request

Accessors:
postBufferingBufsize(), setPostBufferingBufsize()

Definition at line 228 of file wsgi.h.

QString CWSGI::WSGI::processes
readwrite

Defines the number of processes to use, if set to "auto" the ideal processes count is used

Accessors:
threads(), setThreads()

Definition at line 89 of file wsgi.h.

bool CWSGI::WSGI::so_keepalive
readwrite

Enable SO_KEEPALIVE for the sockets

Accessors:
soKeepalive(), setSoKeepalive()

Definition at line 244 of file wsgi.h.

QString CWSGI::WSGI::socket_access
readwrite

Defines the file permissions of a local socket, u = user, g = group, o = others

Accessors:
socketAccess(), setSocketAccess()

Definition at line 130 of file wsgi.h.

int CWSGI::WSGI::socket_rcvbuf
readwrite

Sets the socket receive buffer size in bytes at the OS level. This maps to the SO_RCVBUF socket option

Accessors:
socketRcvbuf(), setSocketRcvbuf()

Definition at line 260 of file wsgi.h.

int CWSGI::WSGI::socket_sndbuf
readwrite

Sets the socket send buffer size in bytes at the OS level. This maps to the SO_SNDBUF socket option

Accessors:
socketSndbuf(), setSocketSndbuf()

Definition at line 252 of file wsgi.h.

int CWSGI::WSGI::socket_timeout
readwrite

Defines set internal socket timeout

Accessors:
socketTimeout(), setSocketTimeout()

Definition at line 138 of file wsgi.h.

QStringList CWSGI::WSGI::static_map
readwrite

Map the mountpoint to static directory (or file)

Accessors:
staticMap(), setStaticMap()

Definition at line 170 of file wsgi.h.

QStringList CWSGI::WSGI::static_map2
readwrite

Map the mountpoint to static directory (or file), completely appending the requested resource to the docroot

Accessors:
staticMap2(), setStaticMap2()

Definition at line 178 of file wsgi.h.

bool CWSGI::WSGI::tcp_nodelay
readwrite

Enable TCP NODELAY on each request

Accessors:
tcpNodelay(), setTcpNodelay()

Definition at line 236 of file wsgi.h.

QString CWSGI::WSGI::threads
readwrite

Defines the number of threads to use, if set to "auto" the ideal thread count is used

Accessors:
threads(), setThreads()

Definition at line 80 of file wsgi.h.

QStringList CWSGI::WSGI::touch_reload
readwrite

Reload application if the specified file is modified or touched

Accessors:
touchReload(), setTouchReload()

Definition at line 203 of file wsgi.h.

QString CWSGI::WSGI::uid
readwrite

Defines user id of the process.

Accessors:
uid(), setUid()

Definition at line 293 of file wsgi.h.

QString CWSGI::WSGI::umask
readwrite

Defines file mode creation mask

Accessors:
umask(), setUmask()

Definition at line 325 of file wsgi.h.

int CWSGI::WSGI::websocket_max_size
readwrite

Sets the maximum allowed size of websocket messages (in Kbytes, default 1024)

Accessors:
websocketMaxSize(), setWebsocketMaxSize()

Definition at line 268 of file wsgi.h.