Support range based header matching for request routing. (#475)
v2 api changes: Use oneof to specify header match options, based on value(exact_match), regex or range. The existing value and regex fields will be deprecated. Use the header_match_specfier oneof instead. Add a new range.proto (envoy.type.v2) for the range type definition. The SInt64Range message is defined in envoy.type.v2 range.proto. It consists of start and end (inclusive, exclusive) sint64 values. v1 api: Add a range_match object to the route headers json. Presence of this object indicates range based route match. Example: For the below route config: { "prefix": "/", "cluster": "PartitionB", "name": "PartitionKey", "range_match": { "start": 0, "end": 10} } In the incoming request, if the PartitionKey header value = 0, route match succeeds. Route match fails if the header value = 10, -10, "somestring". This feature can be used for request routing with Service Fabric stateful services, to route to the desired partition with the [ranged partitioning scheme](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-concepts-partitioning#ranged-partitioning-scheme) Signed-off-by: Kavya Kotacherry <kavyako@microsoft.com>pull/509/head
parent
5d5f29064a
commit
5d452340ed
9 changed files with 105 additions and 1 deletions
@ -0,0 +1,8 @@ |
||||
Types |
||||
========= |
||||
|
||||
.. toctree:: |
||||
:glob: |
||||
:maxdepth: 2 |
||||
|
||||
../type/range.proto |
@ -0,0 +1,14 @@ |
||||
load("//bazel:api_build_system.bzl", "api_proto_library", "api_go_proto_library") |
||||
|
||||
licenses(["notice"]) # Apache 2 |
||||
|
||||
api_proto_library( |
||||
name = "range", |
||||
srcs = ["range.proto"], |
||||
visibility = ["//visibility:public"], |
||||
) |
||||
|
||||
api_go_proto_library( |
||||
name = "range", |
||||
proto = ":range", |
||||
) |
@ -0,0 +1,15 @@ |
||||
syntax = "proto3"; |
||||
|
||||
package envoy.type; |
||||
|
||||
// [#protodoc-title: Range] |
||||
|
||||
// Specifies the int64 start and end of the range using half-open interval semantics [start, |
||||
// end). |
||||
message Int64Range { |
||||
// start of the range (inclusive) |
||||
int64 start = 1; |
||||
|
||||
// end of the range (exclusive) |
||||
int64 end = 2; |
||||
} |
Loading…
Reference in new issue