@@ -2,6 +2,30 @@
Loading
2 2
3 3
import com.twitter.finagle.{Service, ServiceProxy}
4 4
5 +
private[finagle] object Route {
6 +
7 +
  /**
8 +
   * Transform a `Route[UserReq, Rep, Schema]` and its underlying service to a
9 +
   * `Route[Req, Rep, Schema]`.
10 +
   *
11 +
   * @param transformer The function to be used to transform from [[Req request]] to
12 +
   *                    [[UserReq user-facing request]] logic to be used by the [[Route route]]
13 +
   *                    to be built.
14 +
   * @param route The [[Route]] to be transformed.
15 +
   * @tparam Req The underlying [[Service service's]] request type.
16 +
   * @tparam Rep The underlying [[Service service's]] response type.
17 +
   * @tparam Schema The contextual route information type.
18 +
   * @tparam UserReq The user-facing underlying [[Service service's]] request type.
19 +
   *
20 +
   * @return The transformed [[Route]].
21 +
   */
22 +
  def transformed[Req, Rep, Schema, UserReq](
23 +
    transformer: RequestTransformingFilter[Req, Rep, UserReq],
24 +
    route: Route[UserReq, Rep, Schema]
25 +
  ): Route[Req, Rep, Schema] =
26 +
    Route(label = route.label, schema = route.schema, service = transformer.andThen(route.service))
27 +
}
28 +
5 29
/**
6 30
 * A [[Route]] is responsible for servicing traffic for a [[RoutingService RoutingService's]]
7 31
 * defined endpoint. A [[Route]] has a similar role to a [[Service]], with the added ability to
Files Coverage
finagle-base-http/src/main/scala/com/twitter/finagle/http 85.08%
finagle-core/src/main/scala/com/twitter/finagle 85.66%
finagle-exception/src/main/scala/com/twitter/finagle/exception 79.66%
finagle-exp/src/main/scala/com/twitter/finagle/exp 91.00%
finagle-http/src/main/scala/com/twitter/finagle 81.89%
finagle-http2/src/main/scala/com/twitter/finagle/http2 77.07%
finagle-memcached/src/main/scala/com/twitter/finagle 69.63%
finagle-mux/src/main/scala/com/twitter/finagle 76.28%
finagle-mysql/src/main/scala/com/twitter/finagle 66.94%
finagle-netty4-http/src/main/scala/com/twitter/finagle/netty4/http 95.97%
finagle-netty4/src/main/scala/com/twitter/finagle/netty4 87.73%
...le-opencensus-tracing/src/main/scala/com/twitter/finagle/tracing/opencensus 89.89%
finagle-partitioning/src/main/scala/com/twitter/finagle/partitioning 88.11%
finagle-redis/src/main/scala/com/twitter/finagle 36.21%
finagle-scribe/src/main/scala/com/twitter/finagle/scribe 75.93%
finagle-serversets/src/main/scala/com/twitter 79.27%
finagle-stats-core/src/main/scala/com/twitter/finagle/stats 78.01%
finagle-thrift/src/main/scala/com/twitter/finagle 75.22%
finagle-thriftmux/src/main/scala/com/twitter/finagle 87.67%
finagle-toggle/src/main/scala/com/twitter/finagle 86.18%
finagle-zipkin-core/src/main/scala/com/twitter/finagle/zipkin/core 81.40%
finagle-zipkin-scribe/src/main/scala/com/twitter/finagle/zipkin/thrift 78.33%
finagle-stats/src/main/scala/com/twitter/finagle/stats/stats.scala 0.00%
...tunable/src/main/scala/com/twitter/finagle/tunable/StandardTunableMap.scala 56.52%
Project Totals (829 files) 78.10%
3561.28
TRAVIS_OS_NAME=linux
openjdk8=
3561.29
TRAVIS_OS_NAME=linux
openjdk8=
3561.33
TRAVIS_OS_NAME=linux
openjdk8=
3561.30
TRAVIS_OS_NAME=linux
openjdk8=
3561.23
TRAVIS_OS_NAME=linux
openjdk8=
3561.24
TRAVIS_OS_NAME=linux
openjdk8=
3561.27
TRAVIS_OS_NAME=linux
openjdk8=
3561.26
TRAVIS_OS_NAME=linux
openjdk8=
3561.31
TRAVIS_OS_NAME=linux
openjdk8=
3561.36
TRAVIS_OS_NAME=linux
openjdk8=
3561.2
TRAVIS_OS_NAME=linux
openjdk8=
3561.4
TRAVIS_OS_NAME=linux
openjdk8=
3561.9
TRAVIS_OS_NAME=linux
openjdk8=
3561.66
openjdk11=
TRAVIS_OS_NAME=linux
3561.61
openjdk11=
TRAVIS_OS_NAME=linux
3561.60
TRAVIS_OS_NAME=linux
openjdk8=
3561.59
TRAVIS_OS_NAME=linux
openjdk8=
3561.62
openjdk11=
TRAVIS_OS_NAME=linux
3561.63
openjdk11=
TRAVIS_OS_NAME=linux
3561.55
TRAVIS_OS_NAME=linux
openjdk8=