@@ -242,9 +242,9 @@ The following methods on context object are supported.
242
242
### httpCall
243
243
244
244
``` {.sourceCode .cpp}
245
- void httpCall(StringView cluster,
245
+ void httpCall(std::string_view cluster,
246
246
const HeaderStringPairs& request_headers,
247
- StringView request_body,
247
+ std::string_view request_body,
248
248
const HeaderStringPairs& request_trailers,
249
249
uint32_t timeout_milliseconds,
250
250
HttpCallCallback callback)
@@ -270,13 +270,13 @@ called when the HTTP request finishes.
270
270
271
271
``` {.sourceCode .cpp}
272
272
template<typename Response>
273
- void grpcSimpleCall(StringView service,
274
- StringView service_name,
275
- StringView method_name,
273
+ void grpcSimpleCall(std::string_view service,
274
+ std::string_view service_name,
275
+ std::string_view method_name,
276
276
const google::protobuf::MessageLite &request,
277
277
uint32_t timeout_milliseconds,
278
278
std::function<void(Response&& response)> success_callback,
279
- std::function<void(GrpcStatus status, StringView error_message)> failure_callback)
279
+ std::function<void(GrpcStatus status, std::string_view error_message)> failure_callback)
280
280
```
281
281
282
282
Makes a unary gRPC call to an upstream host.
@@ -304,9 +304,9 @@ invoked when gRPC call fails. *status* is the returned gRPC status code.
304
304
305
305
``` {.sourceCode .cpp}
306
306
void grpcCallHandler(
307
- StringView service,
308
- StringView service_name,
309
- StringView method_name,
307
+ std::string_view service,
308
+ std::string_view service_name,
309
+ std::string_view method_name,
310
310
const google::protobuf::MessageLite &request,
311
311
uint32_t timeout_milliseconds,
312
312
std::unique_ptr<GrpcCallHandlerBase> handler)
@@ -323,9 +323,9 @@ target for callback and fine grained control on the call.
323
323
### grpcStreamHandler
324
324
325
325
``` {.sourceCode .cpp}
326
- void grpcStreamHandler(StringView service,
327
- StringView service_name,
328
- StringView method_name,
326
+ void grpcStreamHandler(std::string_view service,
327
+ std::string_view service_name,
328
+ std::string_view method_name,
329
329
std::unique_ptr<GrpcStreamHandlerBase> handler)
330
330
```
331
331
@@ -367,7 +367,7 @@ Header API
367
367
### addRequestHeader
368
368
369
369
``` {.sourceCode .cpp}
370
- void addRequestHeader(StringView key, StringView value)
370
+ void addRequestHeader(std::string_view key, StringView value)
371
371
```
372
372
373
373
Adds a new request header with the key and value if header does not
@@ -378,7 +378,7 @@ only when called in
378
378
### replaceRequestHeader
379
379
380
380
``` {.sourceCode .cpp}
381
- void replaceRequestHeader(StringView key, StringView value)
381
+ void replaceRequestHeader(std::string_view key, StringView value)
382
382
```
383
383
384
384
Replaces the value of an existing request header with the given key, or
@@ -389,7 +389,7 @@ method is effective only when called in
389
389
### removeRequestHeader
390
390
391
391
``` {.sourceCode .cpp}
392
- void removeRequestHeader(StringView key)
392
+ void removeRequestHeader(std::string_view key)
393
393
```
394
394
395
395
Removes request header with the given key. No-op if the request header
@@ -410,7 +410,7 @@ effective only when called in
410
410
### getRequestHeader
411
411
412
412
``` {.sourceCode .cpp}
413
- WasmDataPtr getRequestHeader(StringView key)
413
+ WasmDataPtr getRequestHeader(std::string_view key)
414
414
```
415
415
416
416
Gets value of header with the given key. Returns empty string if header
@@ -437,7 +437,7 @@ contains header pairs data.
437
437
### addResponseHeader
438
438
439
439
``` {.sourceCode .cpp}
440
- void addResponseHeader(StringView key, StringView value)
440
+ void addResponseHeader(std::string_view key, StringView value)
441
441
```
442
442
443
443
Adds a new response header with the key and value if header does not
@@ -448,7 +448,7 @@ only when called in
448
448
### replaceResponseHeader
449
449
450
450
``` {.sourceCode .cpp}
451
- void replaceResponseHeader(StringView key, StringView value)
451
+ void replaceResponseHeader(std::string_view key, StringView value)
452
452
```
453
453
454
454
Replaces the value of an existing response header with the given key, or
@@ -459,7 +459,7 @@ This method is effective only when called in
459
459
### removeResponseHeader
460
460
461
461
``` {.sourceCode .cpp}
462
- void removeResponseHeader(StringView key)
462
+ void removeResponseHeader(std::string_view key)
463
463
```
464
464
465
465
Removes response header with the given key. No-op if the response header
@@ -480,7 +480,7 @@ is effective only when called in
480
480
### getResponseHeader
481
481
482
482
``` {.sourceCode .cpp}
483
- WasmDataPtr getResponseHeader(StringView key)
483
+ WasmDataPtr getResponseHeader(std::string_view key)
484
484
```
485
485
486
486
Gets value of header with the given key. Returns empty string if header
@@ -507,7 +507,7 @@ holds the header pairs.
507
507
### addRequestTrailer
508
508
509
509
``` {.sourceCode .cpp}
510
- void addRequestTrailer(StringView key, StringView value)
510
+ void addRequestTrailer(std::string_view key, StringView value)
511
511
```
512
512
513
513
Adds a new request trailer with the key and value if trailer does not
@@ -518,7 +518,7 @@ only when called in
518
518
### replaceRequestTrailer
519
519
520
520
``` {.sourceCode .cpp}
521
- void replaceRequestTrailer(StringView key, StringView value)
521
+ void replaceRequestTrailer(std::string_view key, StringView value)
522
522
```
523
523
524
524
Replaces the value of an existing request trailer with the given key, or
@@ -529,7 +529,7 @@ This method is effective only when called in
529
529
### removeRequestTrailer
530
530
531
531
``` {.sourceCode .cpp}
532
- void removeRequestTrailer(StringView key)
532
+ void removeRequestTrailer(std::string_view key)
533
533
```
534
534
535
535
Removes request trailer with the given key. No-op if the request trailer
@@ -550,7 +550,7 @@ effective only when called in
550
550
### getRequestTrailer
551
551
552
552
``` {.sourceCode .cpp}
553
- WasmDataPtr getRequestTrailer(StringView key)
553
+ WasmDataPtr getRequestTrailer(std::string_view key)
554
554
```
555
555
556
556
Gets value of trailer with the given key. Returns empty string if
@@ -575,7 +575,7 @@ holds the trailer pairs.
575
575
### addResponseTrailer
576
576
577
577
``` {.sourceCode .cpp}
578
- void addResponseTrailer(StringView key, StringView value)
578
+ void addResponseTrailer(std::string_view key, StringView value)
579
579
```
580
580
581
581
Adds a new response trailer with the key and value if trailer does not
@@ -586,7 +586,7 @@ only when called in
586
586
### replaceResponseTrailer
587
587
588
588
``` {.sourceCode .cpp}
589
- void replaceResponseTrailer(StringView key, StringView value)
589
+ void replaceResponseTrailer(std::string_view key, StringView value)
590
590
```
591
591
592
592
Replaces the value of an existing response trailer with the given key,
@@ -597,7 +597,7 @@ This method is effective only when called in
597
597
### removeResponseTrailer
598
598
599
599
``` {.sourceCode .cpp}
600
- void removeResponseTrailer(StringView key)
600
+ void removeResponseTrailer(std::string_view key)
601
601
```
602
602
603
603
Removes response trailer with the given key. No-op if the response
@@ -618,7 +618,7 @@ method is effective only when called in
618
618
### getResponseTrailer
619
619
620
620
``` {.sourceCode .cpp}
621
- WasmDataPtr getResponseTrailer(StringView key)
621
+ WasmDataPtr getResponseTrailer(std::string_view key)
622
622
```
623
623
624
624
Gets value of trailer with the given key. Returns empty string if
@@ -733,7 +733,7 @@ host stats sink.
733
733
#### New
734
734
735
735
``` {.sourceCode .cpp}
736
- static Counter<Tags...>* New(StringView name, MetricTagDescriptor<Tags>... fieldnames)
736
+ static Counter<Tags...>* New(std::string_view name, MetricTagDescriptor<Tags>... fieldnames)
737
737
```
738
738
739
739
Create a new counter with the given metric name and tag names. Example
@@ -816,7 +816,7 @@ Returns current value of a counter.
816
816
#### New
817
817
818
818
``` {.sourceCode .cpp}
819
- static Gauge<Tags...>* New(StringView name, MetricTagDescriptor<Tags>... fieldnames)
819
+ static Gauge<Tags...>* New(std::string_view name, MetricTagDescriptor<Tags>... fieldnames)
820
820
```
821
821
822
822
Create a new gauge with the given metric name and tag names. Example
@@ -900,7 +900,7 @@ Returns current value of a gauge.
900
900
#### New
901
901
902
902
``` {.sourceCode .cpp}
903
- static Histogram<Tags...>* New(StringView name, MetricTagDescriptor<Tags>... fieldnames)
903
+ static Histogram<Tags...>* New(std::string_view name, MetricTagDescriptor<Tags>... fieldnames)
904
904
```
905
905
906
906
Create a new histogram object with the given metric name and tag names.
@@ -1138,7 +1138,7 @@ Returns the start pointer of the data.
1138
1138
#### view
1139
1139
1140
1140
``` {.sourceCode .cpp}
1141
- StringView view()
1141
+ std::string_view view()
1142
1142
```
1143
1143
1144
1144
Returns data as a string view constructed with the start pointer and the
@@ -1155,7 +1155,7 @@ Returns data as a string by converting the string view to string.
1155
1155
#### pairs
1156
1156
1157
1157
``` {.sourceCode .cpp}
1158
- std::vector<std::pair<StringView , StringView>> pairs()
1158
+ std::vector<std::pair<std::string_view , StringView>> pairs()
1159
1159
```
1160
1160
1161
1161
Returns a vector of string view pair parsed from the data.
0 commit comments