package dsl
- Source
- package.scala
- Alphabetic
- By Inheritance
- dsl
- Http4s
- AllSyntax
- TaskRequestSyntax
- TaskResponseSyntax
- StringSyntax
- ServiceSyntax
- Http4sFunctions
- UriFunctions
- QValueFunctions
- Http4sInstances
- StatusInstances
- MethodInstances
- QValueInstances
- CharsetRangeInstances
- EntityEncoderInstances
- EntityEncoderInstances0
- HttpVersionInstances
- EntityDecoderInstances
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- final case class /(parent: Path, child: String) extends Path with Product with Serializable
- implicit final class AcceptedSyntax extends AnyVal with EntityResponseGenerator
- implicit final class AlreadyReportedSyntax extends AnyVal with EntityResponseGenerator
- implicit final class BadGatewaySyntax extends AnyVal with EntityResponseGenerator
- implicit final class BadRequestSyntax extends AnyVal with EntityResponseGenerator
- implicit final class ConflictSyntax extends AnyVal with EntityResponseGenerator
- implicit final class ContinueSyntax extends AnyVal with EmptyResponseGenerator
- implicit final class CreatedSyntax extends AnyVal with EntityResponseGenerator
- implicit final class ExpectationFailedSyntax extends AnyVal with EntityResponseGenerator
- implicit final class FailedDependencySyntax extends AnyVal with EntityResponseGenerator
- implicit final class ForbiddenSyntax extends AnyVal with EntityResponseGenerator
- implicit final class FoundSyntax extends AnyVal with LocationResponseGenerator
- implicit final class GatewayTimeoutSyntax extends AnyVal with EntityResponseGenerator
- implicit final class GoneSyntax extends AnyVal with EntityResponseGenerator
- implicit final class HttpVersionNotSupportedSyntax extends AnyVal with EntityResponseGenerator
- implicit final class IMUsedSyntax extends AnyVal with EntityResponseGenerator
- implicit final class InsufficientStorageSyntax extends AnyVal with EntityResponseGenerator
- implicit final class InternalServerErrorSyntax extends AnyVal with EntityResponseGenerator
- implicit final class LengthRequiredSyntax extends AnyVal with EntityResponseGenerator
- implicit final class LockedSyntax extends AnyVal with EntityResponseGenerator
- implicit final class LoopDetectedSyntax extends AnyVal with EntityResponseGenerator
- class MethodConcat extends AnyRef
- implicit final class MethodConcatOps extends AnyVal
- implicit final class MethodNotAllowedSyntax extends AnyVal with EntityResponseGenerator
- implicit final class MethodOps extends AnyVal
- implicit final class MovedPermanentlySyntax extends AnyVal with LocationResponseGenerator
- implicit final class MultipleChoicesSyntax extends AnyVal with LocationResponseGenerator
- implicit final class Multiyntax extends AnyVal with EntityResponseGenerator
- implicit final class NetworkAuthenticationRequiredSyntax extends AnyVal with EntityResponseGenerator
- implicit final class NoContentSyntax extends AnyVal with EmptyResponseGenerator
- implicit final class NonAuthoritativeInformationSyntax extends AnyVal with EntityResponseGenerator
- implicit final class NotAcceptableSyntax extends AnyVal with EntityResponseGenerator
- implicit final class NotExtendedSyntax extends AnyVal with EntityResponseGenerator
- implicit final class NotFoundSyntax extends AnyVal with EntityResponseGenerator
- implicit final class NotImplementedSyntax extends AnyVal with EntityResponseGenerator
- implicit final class NotModifiedSyntax extends AnyVal with EmptyResponseGenerator
-
class
NumericPathVar[A <: AnyVal] extends AnyRef
- Attributes
- protected
- implicit final class OkSyntax extends AnyVal with EntityResponseGenerator
-
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 => { ... } ) }
- implicit final class PartialContentSyntax extends AnyVal with EntityResponseGenerator
-
abstract
class
Path extends AnyRef
Base class for path extractors.
- implicit final class PayloadTooLargeSyntax extends AnyVal with EntityResponseGenerator
- implicit final class PaymentRequiredSyntax extends AnyVal with EntityResponseGenerator
- implicit final class PermanentRedirectSyntax extends AnyVal with LocationResponseGenerator
- implicit final class PreconditionFailedSyntax extends AnyVal with EntityResponseGenerator
- implicit final class PreconditionRequiredSyntax extends AnyVal with EntityResponseGenerator
- implicit final class ProxyAuthenticationRequiredSyntax extends AnyVal with EntityResponseGenerator
-
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) => ...
- implicit final class RangeNotSatisfiableSyntax extends AnyVal with EntityResponseGenerator
- implicit final class RequestHeaderFieldsTooLargeSyntax extends AnyVal with EntityResponseGenerator
- implicit final class RequestTimeoutSyntax extends AnyVal with EntityResponseGenerator
- implicit final class ResetContentSyntax extends AnyVal with EmptyResponseGenerator
- implicit final class SeeOtherSyntax extends AnyVal with LocationResponseGenerator
- implicit final class ServiceUnavailableSyntax extends AnyVal with EntityResponseGenerator
- implicit final class SwitchingProtocolsSyntax extends AnyVal with EmptyResponseGenerator
- implicit final class TemporaryRedirectSyntax extends AnyVal with LocationResponseGenerator
- implicit final class TooManyRequestsSyntax extends AnyVal with EntityResponseGenerator
- implicit final class UnauthorizedSyntax extends AnyVal with WwwAuthenticateResponseGenerator
- implicit final class UnavailableForLegalReasonsSyntax extends AnyVal with EntityResponseGenerator
- implicit final class UnprocessableEntitySyntax extends AnyVal with EntityResponseGenerator
- implicit final class UnsupportedMediaTypeSyntax extends AnyVal with EntityResponseGenerator
- implicit final class UpgradeRequiredSyntax extends AnyVal with EntityResponseGenerator
- implicit final class UriTooLongSyntax extends AnyVal with EntityResponseGenerator
-
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 => { ... } ) }
- implicit final class VariantAlsoNegotiatesSyntax extends AnyVal with EntityResponseGenerator
Value Members
- val Accepted: Status.Accepted.type
- val AlreadyReported: Status.AlreadyReported.type
- val BadGateway: Status.BadGateway.type
- val BadRequest: Status.BadRequest.type
- val CONNECT: Method.CONNECT
-
implicit
val
CharacterSetEqual: Eq[CharsetRange]
- Definition Classes
- CharsetRangeInstances
-
implicit
val
CharsetShow: Show[Charset]
- Definition Classes
- CharsetRangeInstances
- val Conflict: Status.Conflict.type
- val Continue: Status.Continue.type
- val Created: Status.Created.type
- val DELETE: Method.DELETE
- val ExpectationFailed: Status.ExpectationFailed.type
- val FailedDependency: Status.FailedDependency.type
- val Forbidden: Status.Forbidden.type
- val Found: Status.Found.type
- val GET: Method.GET
- val GatewayTimeout: Status.GatewayTimeout.type
- val Gone: Status.Gone.type
- val HEAD: Method.HEAD
- val HttpVersionNotSupported: Status.HttpVersionNotSupported.type
-
implicit
val
HttpVersionOrder: Order[HttpVersion]
- Definition Classes
- HttpVersionInstances
-
implicit
val
HttpVersionShow: Show[HttpVersion]
- Definition Classes
- HttpVersionInstances
- val IMUsed: Status.IMUsed.type
- val InsufficientStorage: Status.InsufficientStorage.type
- val InternalServerError: Status.InternalServerError.type
- val LengthRequired: Status.LengthRequired.type
- val Locked: Status.Locked.type
- val LoopDetected: Status.LoopDetected.type
-
implicit
val
MethodInstances: Show[Method] with Eq[Method]
- Definition Classes
- MethodInstances
- val MethodNotAllowed: Status.MethodNotAllowed.type
- val MovedPermanently: Status.MovedPermanently.type
- val MultiStatus: Status.MultiStatus.type
- val MultipleChoices: Status.MultipleChoices.type
- val NetworkAuthenticationRequired: Status.NetworkAuthenticationRequired.type
- val NoContent: Status.NoContent.type
- val NonAuthoritativeInformation: Status.NonAuthoritativeInformation.type
- val NotAcceptable: Status.NotAcceptable.type
- val NotExtended: Status.NotExtended.type
- val NotFound: Status.NotFound.type
- val NotImplemented: Status.NotImplemented.type
- val NotModified: Status.NotModified.type
- val OPTIONS: Method.OPTIONS
- val Ok: Status.Ok.type
- val PATCH: Method.PATCH
- val POST: Method.POST
- val PUT: Method.PUT
- val PartialContent: Status.PartialContent.type
- val PayloadTooLarge: Status.PayloadTooLarge.type
- val PaymentRequired: Status.PaymentRequired.type
- val PermanentRedirect: Status.PermanentRedirect.type
- val PreconditionFailed: Status.PreconditionFailed.type
- val PreconditionRequired: Status.PreconditionRequired.type
- val Processing: Status.Processing.type
- val ProxyAuthenticationRequired: Status.ProxyAuthenticationRequired.type
- val RangeNotSatisfiable: Status.RangeNotSatisfiable.type
- val RequestHeaderFieldsTooLarge: Status.RequestHeaderFieldsTooLarge.type
- val RequestTimeout: Status.RequestTimeout.type
- val ResetContent: Status.ResetContent.type
- val SeeOther: Status.SeeOther.type
- val ServiceUnavailable: Status.ServiceUnavailable.type
-
implicit
val
StatusOrder: Order[Status]
- Definition Classes
- StatusInstances
-
implicit
val
StatusShow: Show[Status]
- Definition Classes
- StatusInstances
- val SwitchingProtocols: Status.SwitchingProtocols.type
- val TRACE: Method.TRACE
- val TemporaryRedirect: Status.TemporaryRedirect.type
- val TooManyRequests: Status.TooManyRequests.type
- val Unauthorized: Status.Unauthorized.type
- val UnavailableForLegalReasons: Status.UnavailableForLegalReasons.type
- val UnprocessableEntity: Status.UnprocessableEntity.type
- val UnsupportedMediaType: Status.UnsupportedMediaType.type
- val UpgradeRequired: Status.UpgradeRequired.type
- val UriTooLong: Status.UriTooLong.type
- val UseProxy: Status.UseProxy.type
- val VariantAlsoNegotiates: Status.VariantAlsoNegotiates.type
-
def
binFile(file: File): EntityDecoder[File]
- Definition Classes
- EntityDecoderInstances
-
implicit
val
binary: EntityDecoder[Chunk[Byte]]
- Definition Classes
- EntityDecoderInstances
-
implicit
val
byteArrayEncoder: EntityEncoder[Array[Byte]]
- Definition Classes
- EntityEncoderInstances
-
implicit
def
charArrayEncoder(implicit charset: Charset = DefaultCharset): EntityEncoder[Array[Char]]
- Definition Classes
- EntityEncoderInstances
-
implicit
val
chunkEncoder: EntityEncoder[Chunk[Byte]]
- Definition Classes
- EntityEncoderInstances
-
def
emptyEncoder[A]: EntityEncoder[A]
- Definition Classes
- EntityEncoderInstances0
-
implicit
def
entityBodyEncoder: EntityEncoder[EntityBody]
Encodes an entity body.
Encodes an entity body. Chunking of the stream is preserved. A
Transfer-Encoding: chunked
header is set, as we cannot know the content length without running the stream.- Definition Classes
- EntityEncoderInstances
-
implicit
val
entityEncoderContravariant: Contravariant[EntityEncoder]
- Definition Classes
- EntityEncoderInstances
-
def
error[T](t: Throwable): EntityDecoder[T]
Provides a mechanism to fail decoding
Provides a mechanism to fail decoding
- Definition Classes
- EntityDecoderInstances
-
implicit
val
fileEncoder: EntityEncoder[File]
- Definition Classes
- EntityEncoderInstances
-
implicit
val
filePathEncoder: EntityEncoder[java.nio.file.Path]
- Definition Classes
- EntityEncoderInstances
-
implicit
def
futureEncoder[A](implicit W: EntityEncoder[A], ec: ExecutionContext): EntityEncoder[Future[A]]
- Definition Classes
- EntityEncoderInstances0
-
implicit
def
http4sServiceSyntax[A](service: Service[A, MaybeResponse]): ServiceOps[A]
- Definition Classes
- ServiceSyntax
-
implicit
def
http4sStringSyntax(s: String): StringOps
- Definition Classes
- StringSyntax
-
implicit
def
http4sTaskRequestSyntax(req: Task[Request]): TaskRequestOps
- Definition Classes
- TaskRequestSyntax
-
implicit
def
http4sTaskResponseSyntax(resp: Task[Response]): TaskResponseOps
- Definition Classes
- TaskResponseSyntax
-
implicit
def
inputStreamEncoder[A <: InputStream]: EntityEncoder[Eval[A]]
- Definition Classes
- EntityEncoderInstances
-
implicit
def
multipart: EntityDecoder[Multipart]
- Definition Classes
- EntityDecoderInstances
-
implicit
val
multipartEncoder: EntityEncoder[Multipart]
- Definition Classes
- EntityEncoderInstances
-
implicit
def
naturalTransformationEncoder[F[_], A](implicit N: ~>[F, Task], W: EntityEncoder[A]): EntityEncoder[F[A]]
- Definition Classes
- EntityEncoderInstances0
-
implicit
def
pureStreamEncoder[A](implicit W: EntityEncoder[A]): EntityEncoder[Stream[Nothing, A]]
- Definition Classes
- EntityEncoderInstances0
-
macro
def
q(d: Double): QValue
Supports a literal syntax for validated QValues.
Supports a literal syntax for validated QValues.
Example:
q(0.5).success == QValue.fromDouble(0.5) q(1.1) // does not compile: out of range val d = 0.5 q(d) // does not compile: not a literal
- Definition Classes
- QValueFunctions
-
implicit
val
qValueOrder: Order[QValue]
- Definition Classes
- QValueInstances
-
implicit
val
qValueShow: Show[QValue]
- Definition Classes
- QValueInstances
-
implicit
def
readerEncoder[A <: Reader](implicit charset: Charset = DefaultCharset): EntityEncoder[Task[A]]
- Definition Classes
- EntityEncoderInstances
-
def
removeDotSegments(path: Uri.Path): Uri.Path
Remove dot sequences from a Path, per RFC 3986 Sec 5.2.4
Remove dot sequences from a Path, per RFC 3986 Sec 5.2.4
- Definition Classes
- UriFunctions
-
def
resolve(base: Uri, reference: Uri): Uri
Resolve a relative Uri reference, per RFC 3986 sec 5.2
Resolve a relative Uri reference, per RFC 3986 sec 5.2
- Definition Classes
- UriFunctions
-
implicit
val
serverSentEventEncoder: EntityEncoder[EventStream]
- Definition Classes
- EntityEncoderInstances
-
def
showEncoder[A](implicit charset: Charset = DefaultCharset, show: Show[A]): EntityEncoder[A]
Encodes a value from its Show instance.
Encodes a value from its Show instance. Too broad to be implicit, too useful to not exist.
- Definition Classes
- EntityEncoderInstances0
-
implicit
def
sourceEncoder[A](implicit W: EntityEncoder[A]): EntityEncoder[Stream[Task, A]]
A process encoder is intended for streaming, and does not calculate its bodies in advance.
A process encoder is intended for streaming, and does not calculate its bodies in advance. As such, it does not calculate the Content-Length in advance. This is for use with chunked transfer encoding.
- Definition Classes
- EntityEncoderInstances0
-
implicit
def
stringEncoder(implicit charset: Charset = DefaultCharset): EntityEncoder[String]
- Definition Classes
- EntityEncoderInstances
-
implicit
def
taskEncoder[A](implicit W: EntityEncoder[A]): EntityEncoder[Task[A]]
- Definition Classes
- EntityEncoderInstances
-
implicit
def
text(implicit defaultCharset: Charset = DefaultCharset): EntityDecoder[String]
- Definition Classes
- EntityDecoderInstances
-
def
textFile(file: File): EntityDecoder[File]
- Definition Classes
- EntityDecoderInstances
-
implicit
val
unitEncoder: EntityEncoder[Unit]
- Definition Classes
- EntityEncoderInstances
-
macro
def
uri(s: String): Uri
Literal syntax for URIs.
Literal syntax for URIs. Invalid or non-literal arguments are rejected at compile time.
- Definition Classes
- UriFunctions
-
implicit
val
void: EntityDecoder[Unit]
An entity decoder that ignores the content and returns unit.
An entity decoder that ignores the content and returns unit.
- Definition Classes
- EntityDecoderInstances
-
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
Root extends Path with Product with Serializable
Root extractor:
Root extractor:
Path("/") match { case Root => ... }
- object as
-
object
~
File extension extractor