package impl
- Alphabetic
- Public
- All
Type Members
- case class /(parent: Path, child: String) extends Path with Product with Serializable
- trait Auth extends AnyRef
-
trait
EmptyResponseGenerator[F[_]] extends ResponseGenerator
Helper for the generation of a org.http4s.Response which will not contain a body
Helper for the generation of a org.http4s.Response which will not contain a body
While it is possible to for the org.http4s.Response manually, the EntityResponseGenerators offer shortcut syntax to make intention clear and concise.
val resp: F[Response] = Status.Continue()
Example: -
trait
EntityResponseGenerator[F[_]] extends ResponseGenerator
Helper for the generation of a org.http4s.Response which may contain a body
Helper for the generation of a org.http4s.Response which may contain a body
While it is possible to construct the org.http4s.Response manually, the EntityResponseGenerators offer shortcut syntax to make intention clear and concise.
val resp: IO[Response] = Ok("Hello world!")
Example: - trait LocationResponseGenerator[F[_]] extends EntityResponseGenerator[F]
- class MethodConcat extends AnyRef
- trait Methods extends AnyRef
-
class
NumericPathVar[A <: AnyVal] extends AnyRef
- Attributes
- protected
-
abstract
class
OptionalMultiQueryParamDecoderMatcher[T] extends AnyRef
Capture a query parameter that appears 0 or more times.
Capture a query parameter that appears 0 or more times.
case class Foo(i: Int) implicit val fooDecoder: QueryParamDecoder[Foo] = ... implicit val fooParam: QueryParam[Foo] = ... object FooMatcher extends OptionalMultiQueryParamDecoderMatcher[Foo]("foo") val service: HttpService = { // matches http://.../closest?foo=2&foo=3&foo=4 case GET -> Root / "closest" :? FooMatcher(Some(Seq(2,3,4))) => ... /* * matches http://.../closest?foo=2&foo=3&foo=4 as well as http://.../closest (no parameters) * or http://.../closest?foo=2 (single occurrence) */ case GET -> Root / "closest" :? FooMatcher(is) => ...
- abstract class OptionalQueryParamDecoderMatcher[T] extends AnyRef
- abstract class OptionalQueryParamMatcher[T] extends OptionalQueryParamDecoderMatcher[T]
-
abstract
class
OptionalValidatingQueryParamDecoderMatcher[T] extends AnyRef
param extractor using org.http4s.QueryParamDecoder.
param extractor using org.http4s.QueryParamDecoder. Note that this will _always_ match, but will return an Option possibly containing the result of the conversion to T
case class Foo(i: Int) implicit val fooDecoder: QueryParamDecoder[Foo] = ... case class Bar(i: Int) implicit val barDecoder: QueryParamDecoder[Bar] = ... object FooMatcher extends ValidatingQueryParamDecoderMatcher[Foo]("foo") object BarMatcher extends OptionalValidatingQueryParamDecoderMatcher[Bar]("bar") val service: HttpService = { case GET -> Root / "closest" :? FooMatcher(fooValue) +& BarMatcher(barValue) => { ^(fooValue, barValue getOrElse 42.right) { (foo, bar) => ... }.fold( nelE => BadRequest(nelE.toList.map(_.sanitized).mkString("\n")), baz => { ... } ) }
-
trait
Path extends AnyRef
Base class for path extractors.
- trait ProxyAuthenticateResponseGenerator[F[_]] extends ResponseGenerator
-
abstract
class
QueryParamDecoderMatcher[T] extends AnyRef
param extractor using QueryParamDecoder:
param extractor using QueryParamDecoder:
case class Foo(i: Int) implicit val fooDecoder: QueryParamDecoder[Foo] = ... object FooMatcher extends QueryParamDecoderMatcher[Foo]("foo") val service: HttpService = { case GET -> Root / "closest" :? FooMatcher(2) => ...
-
abstract
class
QueryParamMatcher[T] extends QueryParamDecoderMatcher[T]
param extractor using QueryParamDecoder:
param extractor using QueryParamDecoder:
case class Foo(i: Int) implicit val fooDecoder: QueryParamDecoder[Foo] = ... implicit val fooParam: QueryParam[Foo] = ... object FooMatcher extends QueryParamDecoderMatcher[Foo] val service: HttpService = { case GET -> Root / "closest" :? FooMatcher(2) => ...
- trait ResponseGenerator extends Any
- trait Responses[F[_]] extends AnyRef
- trait Statuses extends AnyRef
-
abstract
class
ValidatingQueryParamDecoderMatcher[T] extends AnyRef
param extractor using org.http4s.QueryParamDecoder.
param extractor using org.http4s.QueryParamDecoder. Note that this will return a ParseFailure if the parameter cannot be decoded.
case class Foo(i: Int) implicit val fooDecoder: QueryParamDecoder[Foo] = ... object FooMatcher extends ValidatingQueryParamDecoderMatcher[Foo]("foo") val service: HttpService = { case GET -> Root / "closest" :? FooMatcher(fooValue) => { fooValue.fold( nelE => BadRequest(nelE.toList.map(_.sanitized).mkString("\n")), foo => { ... } ) }
- trait WwwAuthenticateResponseGenerator[F[_]] extends ResponseGenerator
Value Members
-
object
+&
Multiple param extractor:
Multiple param extractor:
object A extends QueryParamDecoderMatcher[String]("a") object B extends QueryParamDecoderMatcher[Int]("b") val service: HttpService = { case GET -> Root / "user" :? A(a) +& B(b) => ...
- object ->
-
object
/:
Path separator extractor:
Path separator extractor:
Path("/1/2/3/test.json") match { case "1" /: "2" /: _ => ...
- object :?
-
object
IntVar extends NumericPathVar[Int]
Integer extractor of a path variable:
Integer extractor of a path variable:
Path("/user/123") match { case Root / "user" / IntVar(userId) => ...
-
object
LongVar extends NumericPathVar[Long]
Long extractor of a path variable:
Long extractor of a path variable:
Path("/user/123") match { case Root / "user" / LongVar(userId) => ...
- object Path
- object Responses
-
object
Root extends Path with Product with Serializable
Root extractor:
Root extractor:
Path("/") match { case Root => ... }
-
object
~
File extension extractor