package rho
- Alphabetic
- By Inheritance
- rho
- AllSyntax
- LiteralsSyntax
- StringSyntax
- NonEmptyListSyntax
- KleisliSyntax
- AsyncSyntax
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- case class Action[F[_], T <: HList](resultInfo: Set[ResultInfo], responseEncodings: Set[MediaType], act: (Request[F], T) => F[Response[F]]) extends Product with Serializable
Encapsulation of metadata and a result generator
Encapsulation of metadata and a result generator
- T
The type of
HList
required to execute the Action.- resultInfo
Information about the status and type the Action will produce.
- responseEncodings
Encodings that the response supports.
- act
Function of
Request
and theHList
to aTask[Response]
- class AuthedContext[F[_], U] extends FailureResponseOps[F]
The AuthedContext provides a convenient way to define a RhoRoutes which works with http4s authentication middleware.
The AuthedContext provides a convenient way to define a RhoRoutes which works with http4s authentication middleware. Please note that
AuthMiddleware
-wrapping is mandatory, otherwise context doesn't take effect.case class User(name: String, id: UUID) val authUser: Kleisli[IO, Request[IO], Either[String, User]] = Kleisli{ req => IO(Right(User("Bob", UUID.randomUUID()))) } val onFailure: AuthedRoutes[String, IO] = Kleisli(req => OptionT.liftF(Forbidden(req.authInfo))) val middleware = AuthMiddleware(authUser, onFailure) object Auth extends AuthedContext[IO, User] object BobRoutes extends RhoRoutes[IO] { GET +? param("foo", "bar") >>> Auth.auth |>> { (foo: String, user: User) => Ok(s"Bob with id ${user.id}, foo $foo") } } val service = middleware.apply(Auth.toService(BobRoutes.toRoutes()))
- U
authInfo type for this service.
- case class CodecRouter[F[_], T <: HList, R](router: Router[F, T], decoder: EntityDecoder[F, R])(implicit t: scala.reflect.api.JavaUniverse.TypeTag[R]) extends HeaderAppendable[F, T] with RouteExecutable[F, ::[R, T]] with RoutingEntity[F, ::[R, T]] with Decodable[F, T, R] with Product with Serializable
- trait CompileRoutes[F[_], RouteType] extends AnyRef
Transforms a RhoRoute into an
RouteType
.Transforms a RhoRoute into an
RouteType
.This can be a stateful operation, storing the action for later execution or any other type of compilation phase.
- trait Decodable[F[_], T <: HList, R] extends AnyRef
Type that can accept a decoder.
Type that can accept a decoder.
A subtype of Decodable can accept an
EntityDecoder
for extracting a message from theRequest
body. - final class PathBuilder[F[_], T <: HList] extends RouteExecutable[F, T] with Decodable[F, T, Nothing] with HeaderAppendable[F, T] with RoutePrependable[F, PathBuilder[F, T]] with UriConvertible[F]
Fully functional path building
- case class QueryBuilder[F[_], T <: HList](method: Method, path: PathRule, rules: RequestRule[F]) extends RouteExecutable[F, T] with Decodable[F, T, Nothing] with HeaderAppendable[F, T] with UriConvertible[F] with RoutePrependable[F, QueryBuilder[F, T]] with Product with Serializable
Typed builder of query rules
Typed builder of query rules
The QueryBuilder represents a builder for routes that already have a defined method and path. It can accumulate query rules and mount decoders.
- T
The HList representation of the types the route expects to extract from a
Request
.- method
Request method to match.
- path
Path rules to execute.
- rules
Accumulated RequestRule's.
- final case class RequestLineBuilder[F[_], T <: HList](path: PathRule, rules: RequestRule[F]) extends TypedBuilder[F, T] with RoutePrependable[F, RequestLineBuilder[F, T]] with UriConvertible[F] with Product with Serializable
DSL construct for building query rules without a known
Method
DSL construct for building query rules without a known
Method
The RequestLineBuilder doesn't know about header rules or the method.
- T
The
HList
representation of the values to be extracted from theRequest
.
- sealed case class Result[F[_], +CONTINUE, +SWITCHINGPROTOCOLS, +PROCESSING, +EARLYHINTS, +OK, +CREATED, +ACCEPTED, +NONAUTHORITATIVEINFORMATION, +NOCONTENT, +RESETCONTENT, +PARTIALCONTENT, +MULTISTATUS, +ALREADYREPORTED, +IMUSED, +MULTIPLECHOICES, +MOVEDPERMANENTLY, +FOUND, +SEEOTHER, +NOTMODIFIED, +TEMPORARYREDIRECT, +PERMANENTREDIRECT, +BADREQUEST, +UNAUTHORIZED, +PAYMENTREQUIRED, +FORBIDDEN, +NOTFOUND, +METHODNOTALLOWED, +NOTACCEPTABLE, +PROXYAUTHENTICATIONREQUIRED, +REQUESTTIMEOUT, +CONFLICT, +GONE, +LENGTHREQUIRED, +PRECONDITIONFAILED, +PAYLOADTOOLARGE, +URITOOLONG, +UNSUPPORTEDMEDIATYPE, +RANGENOTSATISFIABLE, +EXPECTATIONFAILED, +MISDIRECTEDREQUEST, +UNPROCESSABLEENTITY, +LOCKED, +FAILEDDEPENDENCY, +TOOEARLY, +UPGRADEREQUIRED, +PRECONDITIONREQUIRED, +TOOMANYREQUESTS, +REQUESTHEADERFIELDSTOOLARGE, +UNAVAILABLEFORLEGALREASONS, +INTERNALSERVERERROR, +NOTIMPLEMENTED, +BADGATEWAY, +SERVICEUNAVAILABLE, +GATEWAYTIMEOUT, +HTTPVERSIONNOTSUPPORTED, +VARIANTALSONEGOTIATES, +INSUFFICIENTSTORAGE, +LOOPDETECTED, +NOTEXTENDED, +NETWORKAUTHENTICATIONREQUIRED](resp: Response[F]) extends Product with Serializable
A helper for capturing the result types and status codes from routes
- trait ResultSyntaxInstances[F[_]] extends AnyRef
- trait RhoDslHeaderExtractors[F[_]] extends FailureResponseOps[F]
- trait RhoDslPathExtractors[F[_]] extends AnyRef
- trait RhoDslQueryParamExtractors[F[_]] extends FailureResponseOps[F]
- type RhoMiddleware[F[_]] = (Seq[RhoRoute[F, _ <: HList]]) => Seq[RhoRoute[F, _ <: HList]]
- final case class RhoRoute[F[_], T <: HList](router: RoutingEntity[F, T], action: Action[F, T]) extends RoutePrependable[F, RhoRoute[F, T]] with Product with Serializable
A type to bundle everything needed to define a route
- class RhoRoutes[F[_]] extends MethodAliases with ResponseGeneratorInstances[F] with RoutePrependable[F, RhoRoutes[F]] with RhoDsl[F]
Constructor class for defining routes
Constructor class for defining routes
The RhoRoutes provides a convenient way to define routes in a style similar to scalatra etc by providing implicit conversions and an implicit CompileRoutes inside the constructor.
new RhoRoutes[IO] { POST / "foo" / pathVar[Int] +? param[String]("param") |>> { (p1: Int, param: String) => Ok("success") } }
- trait RouteExecutable[F[_], T <: HList] extends TypedBuilder[F, T]
Object which can be compiled into a complete route The RouteExecutable is a complete set of HTTP method, path, query, and headers needed for a compiler to generate a complete route description.
Object which can be compiled into a complete route The RouteExecutable is a complete set of HTTP method, path, query, and headers needed for a compiler to generate a complete route description.
- T
The
HList
representation of the types the route expects to extract from aRequest
.
- trait RoutePrependable[F[_], T <: RoutePrependable[F, T]] extends AnyRef
Types that extends this trait can be prepended with noncapturing paths
- case class Router[F[_], T <: HList](method: Method, path: PathRule, rules: RequestRule[F]) extends RouteExecutable[F, T] with HeaderAppendable[F, T] with RoutingEntity[F, T] with Decodable[F, T, Nothing] with RoutePrependable[F, Router[F, T]] with Product with Serializable
Provides the operations for generating a router
Provides the operations for generating a router
- T
cumulative type of the required method for executing the router
- method
request methods to match
- path
path matching stack
- rules
header validation stack
- final class RoutesBuilder[F[_]] extends CompileRoutes[F, Tpe[F]]
CompileRoutes which accumulates routes and can build a
HttpRoutes
- sealed trait RoutingEntity[F[_], T <: HList] extends AnyRef
- trait TypedBuilder[F[_], T <: HList] extends UriConvertible[F]
A typed shell which represents the requirements of the route
A typed shell which represents the requirements of the route
- T
The
HList
representation of the values to be extracted from theRequest
.
- trait UriConvertible[F[_]] extends AnyRef
Defines a type that is convertible into an
Uri
orUriTemplate
Value Members
- val PathEmpty: PathRule
- implicit def http4sKleisliResponseSyntaxOptionT[F[_], A](kleisli: Kleisli[[β$0$]OptionT[F, β$0$], A, Response[F]])(implicit arg0: Functor[F]): KleisliResponseOps[F, A]
- Definition Classes
- KleisliSyntax
- implicit def http4sLiteralsSyntax(sc: StringContext): LiteralsOps
- Definition Classes
- LiteralsSyntax
- implicit def http4sStringSyntax(s: String): StringOps
- Definition Classes
- StringSyntax
- object CompileRoutes
- object Result extends Serializable
- object RhoDslPathExtractors
- object RhoRoute extends Serializable
- object RoutesBuilder
- object UriConvertible
- object io extends RhoDsl[IO]
Deprecated Value Members
- implicit def asyncSyntax[F[_], A](async: Async[F]): AsyncOps[F, A]
- Definition Classes
- AsyncSyntax
- Annotations
- @deprecated
- Deprecated
(Since version 0.19.1) Has nothing to do with HTTP
- implicit def http4sNonEmptyListSyntax[A](l: NonEmptyList[A]): NonEmptyListOps[A]
- Definition Classes
- NonEmptyListSyntax
- Annotations
- @deprecated
- Deprecated
(Since version 0.18.5) Use cats.foldable._