Cutelyst  1.5.0
wsgi.h
1 /*
2  * Copyright (C) 2016-2017 Daniel Nicoletti <dantti12@gmail.com>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public License
15  * along with this library; see the file COPYING.LIB. If not, write to
16  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19 #ifndef WSGI_H
20 #define WSGI_H
21 
22 #include <QObject>
23 
24 #include <Cutelyst/cutelyst_global.h>
25 
26 class QCoreApplication;
27 
28 namespace Cutelyst {
29 class Application;
30 }
31 
32 namespace CWSGI {
33 
34 class WSGIPrivate;
39 class CUTELYST_WSGI_EXPORT WSGI : public QObject
40 {
41  Q_OBJECT
42  Q_DECLARE_PRIVATE(WSGI)
43 public:
44  explicit WSGI(QObject *parent = nullptr);
45  virtual ~WSGI();
46 
58  int load(Cutelyst::Application *app = nullptr);
59 
60  Q_PROPERTY(QString application READ application WRITE setApplication)
61  void setApplication(const QString &application);
62  QString application() const;
63 
68  Q_PROPERTY(QString threads READ threads WRITE setThreads)
69  void setThreads(const QString &threads);
70  QString threads() const;
71 
72 #ifdef Q_OS_UNIX
73 
77  Q_PROPERTY(QString processes READ processes WRITE setProcesses)
78  void setProcesses(const QString &process);
79  QString processes() const;
80 #endif
81 
86  Q_PROPERTY(QString chdir READ chdir WRITE setChdir)
87  void setChdir(const QString &chdir);
88  QString chdir() const;
89 
90  Q_PROPERTY(QString http_socket READ httpSocket WRITE setHttpSocket)
91  void setHttpSocket(const QString &httpSocket);
92  QString httpSocket() const;
93 
94  Q_PROPERTY(QString fastcgi_socket READ fastcgiSocket WRITE setFastcgiSocket)
95  void setFastcgiSocket(const QString &fastcgiSocket);
96  QString fastcgiSocket() const;
97 
98  Q_PROPERTY(QString socket_access READ socketAccess WRITE setSocketAccess)
99  void setSocketAccess(const QString &socketAccess);
100  QString socketAccess() const;
101 
106  Q_PROPERTY(int socket_timeout READ socketTimeout WRITE setSocketTimeout)
107  void setSocketTimeout(int timeout);
108  int socketTimeout() const;
109 
114  Q_PROPERTY(QString chdir2 READ chdir2 WRITE setChdir2)
115  void setChdir2(const QString &chdir2);
116  QString chdir2() const;
117 
122  Q_PROPERTY(QString ini READ ini WRITE setIni)
123  void setIni(const QString &ini);
124  QString ini() const;
125 
130  Q_PROPERTY(QString static_map READ staticMap WRITE setStaticMap)
131  void setStaticMap(const QString &staticMap);
132  QString staticMap() const;
133 
138  Q_PROPERTY(QString static_map2 READ staticMap2 WRITE setStaticMap2)
139  void setStaticMap2(const QString &staticMap);
140  QString staticMap2() const;
141 
142  Q_PROPERTY(bool master READ master WRITE setMaster)
143  void setMaster(bool enable);
144  bool master() const;
145 
150  Q_PROPERTY(bool auto_reload READ autoReload WRITE setAutoReload)
151  void setAutoReload(bool enable);
152  bool autoReload() const;
153 
158  Q_PROPERTY(QString touch_reload READ touchReload WRITE setTouchReload)
159  void setTouchReload(const QString &file);
160  QString touchReload() const;
161 
162  Q_PROPERTY(qint64 buffer_size READ bufferSize WRITE setBufferSize)
163  void setBufferSize(qint64 size);
164  int bufferSize() const;
165 
166  Q_PROPERTY(qint64 post_buffering READ postBuffering WRITE setPostBuffering)
167  void setPostBuffering(qint64 size);
168  qint64 postBuffering() const;
169 
170  Q_PROPERTY(qint64 post_buffering_bufsize READ postBufferingBufsize WRITE setPostBufferingBufsize)
171  void setPostBufferingBufsize(qint64 size);
172  qint64 postBufferingBufsize() const;
173 
178  Q_PROPERTY(bool tcp_nodelay READ tcpNodelay WRITE setTcpNodelay)
179  void setTcpNodelay(bool enable);
180  bool tcpNodelay() const;
181 
182  Q_PROPERTY(bool so_keepalive READ soKeepalive WRITE setSoKeepalive)
183  void setSoKeepalive(bool enable);
184  bool soKeepalive() const;
185 
190  Q_PROPERTY(int socket_sndbuf READ socketSndbuf WRITE setSocketSndbuf)
191  void setSocketSndbuf(int value);
192  int socketSndbuf() const;
193 
198  Q_PROPERTY(int socket_rcvbuf READ socketRcvbuf WRITE setSocketRcvbuf)
199  void setSocketRcvbuf(int value);
200  int socketRcvbuf() const;
201 
202 #ifdef Q_OS_UNIX
203 
207  Q_PROPERTY(QString uid READ uid WRITE setUid)
208  void setUid(const QString &uid);
209  QString uid() const;
210 
215  Q_PROPERTY(QString gid READ gid WRITE setGid)
216  void setGid(const QString &gid);
217  QString gid() const;
218 
223  Q_PROPERTY(QString chown_socket READ chownSocket WRITE setChownSocket)
224  void setChownSocket(const QString &chownSocket);
225  QString chownSocket() const;
226 
231  Q_PROPERTY(bool lazy READ lazy WRITE setLazy)
232  void setLazy(bool enable);
233  bool lazy() const;
234 #endif
235 
236 Q_SIGNALS:
240  void ready();
241 
242 protected:
243  WSGIPrivate *d_ptr;
244 };
245 
246 }
247 
248 #endif // WSGI_H
Definition: wsgi.h:32
The Cutelyst namespace holds all public Cutelyst API.
Definition: Mainpage.dox:7
Implements a WSGI server.
Definition: wsgi.h:39
The Cutelyst Application.
Definition: application.h:55