$darkmode
Qore FileLocationHandler Module Reference 2.3
FileLocationHandlerHttp.qc.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
4 /* FileLocationHandlerHttp Copyright 2021 - 2023 Qore Technologies, s.r.o.
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23 */
24 
26 namespace FileLocationHandler {
29 
30 public:
32 
35  "connect_timeout": <FileHandlerOptionInfo>{
36  "type": "int",
37  "desc": "connection timeout in milliseconds",
38  },
39  "encoding": <FileHandlerOptionInfo>{
40  "type": "string",
41  "desc": "the string encoding for any strings returned or sent",
42  },
43  "encoding_passthru": <FileHandlerOptionInfo>{
44  "type": "bool",
45  "desc": "do not decode known content-encodings but rather pass the body through as-is",
46  },
47  "error_passthru": <FileHandlerOptionInfo>{
48  "type": "bool",
49  "desc": "HTTP status codes indicating errors will not cause an `HTTP-CLIENT-RECEIVE-ERROR` exception "
50  "to be raised",
51  },
52  "http_version": <FileHandlerOptionInfo>{
53  "type": "string",
54  "desc": "Either `1.0` or `1.1` for the claimed HTTP protocol version compliancy in outgoing message "
55  "headers",
56  },
57  "method": <FileHandlerOptionInfo>{
58  "type": "string",
59  "desc": "the HTTP method to use; if not given then `GET` is used for reads, and `POST` is used for "
60  "writes",
61  },
62  "proxy": <FileHandlerOptionInfo>{
63  "type": "string",
64  "desc": "The proxy URL for connecting through a proxy",
65  },
66  "redirect_passthru": <FileHandlerOptionInfo>{
67  "type": "bool",
68  "desc": "redirect responses will be passed to the caller instead of followed",
69  },
70  "ssl_cert_data": <FileHandlerOptionInfo>{
71  "type": "data",
72  "desc": "the X.509 certificate data in PEM format (string) or in DER format (binary); if this "
73  "option is set, then `ssl_cert_path` is ignored",
74  },
75  "ssl_cert_path": <FileHandlerOptionInfo>{
76  "type": "string",
77  "desc": "a path to an X.509 client certificate file in PEM format; if this option is used, then the "
78  "calling context must not be restricted with sandbox restriction `PO_NO_FILESYSTEM` which is "
79  "checked at runtime",
80  },
81  "ssl_key_data": <FileHandlerOptionInfo>{
82  "type": "data",
83  "desc": "the X.509 private key data in PEM format (string) or in DER format (binary); if this "
84  "option is set, then `ssl_key_path` is ignored",
85  },
86  "ssl_key_path": <FileHandlerOptionInfo>{
87  "type": "string",
88  "desc": "a path to a private key file in PEM format; if this option is used, then the "
89  "calling context must not be restricted with sandbox restriction `PO_NO_FILESYSTEM` which is "
90  "checked at runtime",
91  },
92  "ssl_key_password": <FileHandlerOptionInfo>{
93  "type": "string",
94  "desc": "the password to the private key given with `ssl_key_path`",
95  },
96  "ssl_verify_cert": <FileHandlerOptionInfo>{
97  "type": "bool",
98  "desc": "the server's certificate will only be accepted if it's verified",
99  },
100  "timeout": <FileHandlerOptionInfo>{
101  "type": "int",
102  "desc": "I/O timeout in milliseconds",
103  },
104  };
105 
107 
115 protected:
116  string getTextFileImpl(string scheme, string location, *hash<auto> opts);
117 public:
118 
119 
121 
129 protected:
130  binary getBinaryFileImpl(string scheme, string location, *hash<auto> opts);
131 public:
132 
133 
135 
141 protected:
142  Qore::AbstractPollOperation getIoPollerForLocationImpl(string scheme, string location, *hash<auto> opts);
143 public:
144 
145 
147 
155 protected:
156  Qore::StreamReader getStreamReaderImpl(string scheme, string location, *hash<auto> opts);
157 public:
158 
159 
161 
169 protected:
170  Qore::InputStream getBinaryStreamImpl(string scheme, string location, *hash<auto> opts);
171 public:
172 
173 
175 
182 protected:
183  writeFileImpl(string scheme, string location, data contents, *hash<auto> opts);
184 public:
185 
186 
188 
201 protected:
202  OutputStreamWrapper getOutputStreamImpl(string scheme, string location, *hash<auto> opts);
203 public:
204 
205 
207 
209 protected:
210  hash<string, hash<FileHandlerOptionInfo>> getReadOptionsImpl();
211 public:
212 
213 
215 
217 protected:
218  hash<string, hash<FileHandlerOptionInfo>> getWriteOptionsImpl();
219 public:
220 
221 
223 
226 protected:
227  HTTPClient getHttpClient(string scheme, string location, *hash<auto> opts, reference<string> path, bool do_connect = True);
228 public:
229 
230 };
231 };
The abstract file location handler class.
Definition: FileLocationHandler.qc.dox.h:53
The class for handling http(s):// locations.
Definition: FileLocationHandlerHttp.qc.dox.h:28
binary getBinaryFileImpl(string scheme, string location, *hash< auto > opts)
Retrieves a binary file from the given location.
Qore::StreamReader getStreamReaderImpl(string scheme, string location, *hash< auto > opts)
Returns a stream reader for the file's data at the given location.
writeFileImpl(string scheme, string location, data contents, *hash< auto > opts)
Writes data to a file at the given location.
Qore::AbstractPollOperation getIoPollerForLocationImpl(string scheme, string location, *hash< auto > opts)
Retrieves an I/O poller to retrieve a binary file from the given location.
string getTextFileImpl(string scheme, string location, *hash< auto > opts)
Retrieves a text file from the given location.
HTTPClient getHttpClient(string scheme, string location, *hash< auto > opts, reference< string > path, bool do_connect=True)
Returns an HTTP client for the given location.
const HttpClientLocationOpts
Valid HTTP location options.
Definition: FileLocationHandlerHttp.qc.dox.h:34
hash< string, hash< FileHandlerOptionInfo > > getWriteOptionsImpl()
Gets supported write options.
Qore::InputStream getBinaryStreamImpl(string scheme, string location, *hash< auto > opts)
Retrieves a binary file from the given location.
hash< string, hash< FileHandlerOptionInfo > > getReadOptionsImpl()
Gets supported read options.
OutputStreamWrapper getOutputStreamImpl(string scheme, string location, *hash< auto > opts)
Returns an output stream for writing data to the given location.
The abstract file location handler class.
Definition: OutputStramWrapper.qc.dox.h:28
const True
binary binary()
Contains all public definitions in the FileLocationHandler module.
Definition: FileLocationHandler.qc.dox.h:26
File handler option info.
Definition: FileLocationHandler.qc.dox.h:28