File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
core/src/main/scala/org/http4s/otel4s/middleware Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -119,7 +119,15 @@ object ServerMiddleware {
119
119
def withDoNotTrace (doNotTrace : RequestPrelude => Boolean ): ServerMiddlewareBuilder [F ] =
120
120
copy(doNotTrace = doNotTrace)
121
121
122
- private def buildTracedF [G [_]: MonadCancelThrow ](
122
+ /** This method is used for building a middleware in a way that abstracts
123
+ * over [[org.http4s.HttpApp `HttpApp` ]] and
124
+ * [[org.http4s.HttpRoutes `HttpRoutes` ]]. In most cases, it is preferable
125
+ * to use the methods that directly build the specific desired type.
126
+ *
127
+ * @see [[buildHttpApp ]]
128
+ * @see [[buildHttpRoutes ]]
129
+ */
130
+ def buildGenericTracedHttp [G [_]: MonadCancelThrow ](
123
131
f : Http [G , F ]
124
132
)(implicit kt : KindTransformer [F , G ]): Http [G , F ] =
125
133
Kleisli { (req : Request [F ]) =>
@@ -170,10 +178,10 @@ object ServerMiddleware {
170
178
}
171
179
172
180
def buildHttpApp (f : HttpApp [F ]): HttpApp [F ] =
173
- buildTracedF (f)
181
+ buildGenericTracedHttp (f)
174
182
175
183
def buildHttpRoutes (f : HttpRoutes [F ]): HttpRoutes [F ] =
176
- buildTracedF (f)
184
+ buildGenericTracedHttp (f)
177
185
}
178
186
179
187
private [middleware] def request [F [_]](
You can’t perform that action at this time.
0 commit comments