Qore FileLocationHandler Module Reference  2.0
FileLocationHandlerHttp.qc.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
4 /* FileLocationHandlerHttp Copyright 2021 - 2022 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": "connstion 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 folllowed",
69  },
70  "ssl_cert_path": <FileHandlerOptionInfo>{
71  "type": "string",
72  "desc": "a path to an X.509 client certificate file in PEM format; if this option is used, then the "
73  "calling context must not be restricted with sandbox restriction `PO_NO_FILESYSTEM` which is "
74  "checked at runtime",
75  },
76  "ssl_key_path": <FileHandlerOptionInfo>{
77  "type": "string",
78  "desc": "a path to a private key file in PEM format; if this option is used, then the "
79  "calling context must not be restricted with sandbox restriction `PO_NO_FILESYSTEM` which is "
80  "checked at runtime",
81  },
82  "ssl_key_password": <FileHandlerOptionInfo>{
83  "type": "string",
84  "desc": "the password to the private key given with `ssl_key_path`",
85  },
86  "ssl_verify_cert": <FileHandlerOptionInfo>{
87  "type": "bool",
88  "desc": "the server's certificate will only be accepted if it's verified",
89  },
90  "timeout": <FileHandlerOptionInfo>{
91  "type": "int",
92  "desc": "I/O timeout in milliseconds",
93  },
94  };
95 
97 
105 protected:
106  string getTextFileImpl(string scheme, string location, *hash<auto> opts);
107 public:
108 
109 
111 
119 protected:
120  binary getBinaryFileImpl(string scheme, string location, *hash<auto> opts);
121 public:
122 
123 
125 
131 protected:
132  Qore::StreamReader getStreamReaderImpl(string scheme, string location, *hash<auto> opts);
133 public:
134 
135 
137 
143 protected:
144  Qore::InputStream getBinaryStreamImpl(string scheme, string location, *hash<auto> opts);
145 public:
146 
147 
149 
154 protected:
155  writeFileImpl(string scheme, string location, data contents, *hash<auto> opts);
156 public:
157 
158 
160 
172 protected:
173  OutputStreamWrapper getOutputStreamImpl(string scheme, string location, *hash<auto> opts);
174 public:
175 
176 
178 
180 protected:
181  hash<string, hash<FileHandlerOptionInfo>> getReadOptionsImpl();
182 public:
183 
184 
186 
188 protected:
189  hash<string, hash<FileHandlerOptionInfo>> getWriteOptionsImpl();
190 public:
191 
192 
194 protected:
195  HTTPClient getHttpClient(string scheme, string location, *hash<auto> opts, reference<string> path);
196 public:
197 
198 };
199 };
The abstract file location handler class.
Definition: FileLocationHandler.qc.dox.h:43
The class for handling file 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.
HTTPClient getHttpClient(string scheme, string location, *hash< auto > opts, reference< string > path)
Returns an HTTP client for the given location.
string getTextFileImpl(string scheme, string location, *hash< auto > opts)
Retrieves a text file from 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
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