1 | <?php |
||
21 | class ApiDocument extends AbstractDocument |
||
22 | { |
||
23 | /** |
||
24 | * name |
||
25 | * @var string $name |
||
26 | */ |
||
27 | protected $name = null; |
||
28 | |||
29 | /** |
||
30 | * hosts |
||
31 | * @var string $hosts |
||
32 | */ |
||
33 | protected $hosts = null; |
||
34 | |||
35 | /** |
||
36 | * uris |
||
37 | * @var string $uris |
||
38 | */ |
||
39 | protected $uris = null; |
||
40 | |||
41 | /** |
||
42 | * methods |
||
43 | * @var string $methods |
||
44 | */ |
||
45 | protected $methods = null; |
||
46 | |||
47 | /** |
||
48 | * upstream url |
||
49 | * @var string $upstreamUrl |
||
50 | */ |
||
51 | protected $upstreamUrl = null; |
||
52 | |||
53 | /** |
||
54 | * strip uri |
||
55 | * @var bool $stripUri |
||
56 | */ |
||
57 | protected $stripUri = true; |
||
58 | |||
59 | /** |
||
60 | * preserve host |
||
61 | * @var bool $preserveHost |
||
62 | */ |
||
63 | protected $preserveHost = false; |
||
64 | |||
65 | /** |
||
66 | * retries |
||
67 | * @var int $retries |
||
68 | */ |
||
69 | protected $retries = 5; |
||
70 | |||
71 | /** |
||
72 | * upstream connect timeout |
||
73 | * @var int $upstreamConnectTimeout |
||
74 | */ |
||
75 | protected $upstreamConnectTimeout = 60000; |
||
76 | |||
77 | /** |
||
78 | * upstream send timeout |
||
79 | * @var int $upstreamSendTimeout |
||
80 | */ |
||
81 | protected $upstreamSendTimeout = 60000; |
||
82 | |||
83 | /** |
||
84 | * upstream read timeout |
||
85 | * @var int $upstreamReadTimeout |
||
86 | */ |
||
87 | protected $upstreamReadTimeout = 60000; |
||
88 | |||
89 | /** |
||
90 | * https only |
||
91 | * @var bool $httpsOnly |
||
92 | */ |
||
93 | protected $httpsOnly = false; |
||
94 | |||
95 | /** |
||
96 | * http if terminated |
||
97 | * @var bool $httpIfTerminated |
||
98 | */ |
||
99 | protected $httpIfTerminated = true; |
||
100 | |||
101 | /** |
||
102 | * set name |
||
103 | * |
||
104 | * @param string $name |
||
105 | * |
||
106 | * @return this |
||
107 | */ |
||
108 | 1 | public function setName(string $name): self |
|
114 | |||
115 | /** |
||
116 | * get name |
||
117 | * |
||
118 | * @return string |
||
119 | */ |
||
120 | 1 | public function getName(): string |
|
124 | |||
125 | /** |
||
126 | * set hosts |
||
127 | * |
||
128 | * @param string $hosts |
||
129 | * |
||
130 | * @return this |
||
131 | */ |
||
132 | 1 | public function setHosts(string $hosts): self |
|
138 | |||
139 | /** |
||
140 | * get hosts |
||
141 | * |
||
142 | * @return string |
||
143 | */ |
||
144 | 1 | public function getHosts(): string |
|
148 | |||
149 | /** |
||
150 | * set uris |
||
151 | * |
||
152 | * @param string $uris |
||
153 | * |
||
154 | * @return this |
||
155 | */ |
||
156 | 1 | public function setUris(string $uris): self |
|
162 | |||
163 | /** |
||
164 | * get uris |
||
165 | * |
||
166 | * @return string |
||
167 | */ |
||
168 | 1 | public function getUris(): string |
|
172 | |||
173 | /** |
||
174 | * set methods |
||
175 | * |
||
176 | * @param string $methods |
||
177 | * |
||
178 | * @return this |
||
179 | */ |
||
180 | 1 | public function setMethods(string $methods): self |
|
186 | |||
187 | /** |
||
188 | * get methods |
||
189 | * |
||
190 | * @return string |
||
191 | */ |
||
192 | 1 | public function getMethods(): string |
|
196 | |||
197 | /** |
||
198 | * set upstream url |
||
199 | * |
||
200 | * @param string $upstreamUrl |
||
201 | * |
||
202 | * @return this |
||
203 | */ |
||
204 | 1 | public function setUpstreamUrl(string $upstreamUrl): self |
|
210 | |||
211 | /** |
||
212 | * get upstream url |
||
213 | * |
||
214 | * @return string |
||
215 | */ |
||
216 | 1 | public function getUpstreamUrl(): string |
|
220 | |||
221 | /** |
||
222 | * set strip uri |
||
223 | * |
||
224 | * @param bool $stripUri |
||
225 | * |
||
226 | * @return this |
||
227 | */ |
||
228 | 1 | public function setStripUri(bool $stripUri): self |
|
234 | |||
235 | /** |
||
236 | * get strip uri |
||
237 | * |
||
238 | * @return bool |
||
239 | */ |
||
240 | 1 | public function getStripUri(): bool |
|
244 | |||
245 | /** |
||
246 | * set preserve host |
||
247 | * |
||
248 | * @param bool $preserveHost |
||
249 | * |
||
250 | * @return this |
||
251 | */ |
||
252 | 1 | public function setPreserveHost(bool $preserveHost): self |
|
258 | |||
259 | /** |
||
260 | * get preserve host |
||
261 | * |
||
262 | * @return bool |
||
263 | */ |
||
264 | 1 | public function getPreserveHost(): bool |
|
268 | |||
269 | /** |
||
270 | * set retries |
||
271 | * |
||
272 | * @param int $retries |
||
273 | * |
||
274 | * @return this |
||
275 | */ |
||
276 | 1 | public function setRetries(int $retries): self |
|
282 | |||
283 | /** |
||
284 | * get retries |
||
285 | * |
||
286 | * @return int |
||
287 | */ |
||
288 | 1 | public function getRetries(): int |
|
292 | |||
293 | /** |
||
294 | * set upstream connect timeout |
||
295 | * |
||
296 | * @param int $upstreamConnectTimeout |
||
297 | * |
||
298 | * @return this |
||
299 | */ |
||
300 | 1 | public function setUpstreamConnectTimeout(int $upstreamConnectTimeout): self |
|
306 | |||
307 | /** |
||
308 | * get upstream connect timeout |
||
309 | * |
||
310 | * @return int |
||
311 | */ |
||
312 | 1 | public function getUpstreamConnectTimeout(): int |
|
316 | |||
317 | /** |
||
318 | * set upstream send timeout |
||
319 | * |
||
320 | * @param int $upstreamSendTimeout |
||
321 | * |
||
322 | * @return this |
||
323 | */ |
||
324 | 1 | public function setUpstreamSendTimeout(int $upstreamSendTimeout): self |
|
330 | |||
331 | /** |
||
332 | * get upstream send timeout |
||
333 | * |
||
334 | * @return int |
||
335 | */ |
||
336 | 1 | public function getUpstreamSendTimeout(): int |
|
340 | |||
341 | /** |
||
342 | * set upstream read timeout |
||
343 | * |
||
344 | * @param int $upstreamReadTimeout |
||
345 | * |
||
346 | * @return this |
||
347 | */ |
||
348 | 1 | public function setUpstreamReadTimeout(int $upstreamReadTimeout): self |
|
354 | |||
355 | /** |
||
356 | * get upstream read timeout |
||
357 | * |
||
358 | * @return int |
||
359 | */ |
||
360 | 1 | public function getUpstreamReadTimeout(): int |
|
364 | |||
365 | /** |
||
366 | * set https only |
||
367 | * |
||
368 | * @param bool $httpsOnly |
||
369 | * |
||
370 | * @return this |
||
371 | */ |
||
372 | 1 | public function setHttpsOnly(bool $httpsOnly): self |
|
378 | |||
379 | /** |
||
380 | * get https only |
||
381 | * |
||
382 | * @return bool |
||
383 | */ |
||
384 | 1 | public function getHttpsOnly(): bool |
|
388 | |||
389 | /** |
||
390 | * set http if terminated |
||
391 | * |
||
392 | * @param bool $httpIfTerminated |
||
393 | * |
||
394 | * @return this |
||
395 | */ |
||
396 | 1 | public function setHttpIfTerminated(bool $httpIfTerminated): self |
|
402 | |||
403 | /** |
||
404 | * get http if terminated |
||
405 | * |
||
406 | * @return bool |
||
407 | */ |
||
408 | 1 | public function getHttpIfTerminated(): bool |
|
412 | |||
413 | /** |
||
414 | * get fields |
||
415 | * |
||
416 | * @return array |
||
417 | */ |
||
418 | 2 | protected function getFields(): array |
|
436 | } |
||
437 |