package rho

Linear Supertypes
AllSyntax, LiteralsSyntax, StringSyntax, NonEmptyListSyntax, KleisliSyntax, AsyncSyntax, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. rho
  2. AllSyntax
  3. LiteralsSyntax
  4. StringSyntax
  5. NonEmptyListSyntax
  6. KleisliSyntax
  7. AsyncSyntax
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Package Members

  1. package bits

Type Members

  1. 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 the HList to a Task[Response]

  2. 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.

  3. 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
  4. 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.

  5. 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 the Request body.

  6. 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

  7. 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.

  8. 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 the Request.

  9. 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

  10. trait ResultSyntaxInstances[F[_]] extends AnyRef
  11. trait RhoDslHeaderExtractors[F[_]] extends FailureResponseOps[F]
  12. trait RhoDslPathExtractors[F[_]] extends AnyRef
  13. trait RhoDslQueryParamExtractors[F[_]] extends FailureResponseOps[F]
  14. type RhoMiddleware[F[_]] = (Seq[RhoRoute[F, _ <: HList]]) => Seq[RhoRoute[F, _ <: HList]]
  15. 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

  16. 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")
      }
    }
  17. 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 a Request.

  18. trait RoutePrependable[F[_], T <: RoutePrependable[F, T]] extends AnyRef

    Types that extends this trait can be prepended with noncapturing paths

  19. 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

  20. final class RoutesBuilder[F[_]] extends CompileRoutes[F, Tpe[F]]

    CompileRoutes which accumulates routes and can build a HttpRoutes

  21. sealed trait RoutingEntity[F[_], T <: HList] extends AnyRef
  22. 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 the Request.

  23. trait UriConvertible[F[_]] extends AnyRef

    Defines a type that is convertible into an Uri or UriTemplate

Value Members

  1. val PathEmpty: PathRule
  2. implicit def http4sKleisliResponseSyntaxOptionT[F[_], A](kleisli: Kleisli[[β$0$]OptionT[F, β$0$], A, Response[F]])(implicit arg0: Functor[F]): KleisliResponseOps[F, A]
    Definition Classes
    KleisliSyntax
  3. implicit def http4sLiteralsSyntax(sc: StringContext): LiteralsOps
    Definition Classes
    LiteralsSyntax
  4. implicit def http4sStringSyntax(s: String): StringOps
    Definition Classes
    StringSyntax
  5. object CompileRoutes
  6. object Result extends Serializable
  7. object RhoDslPathExtractors
  8. object RhoRoute extends Serializable
  9. object RoutesBuilder
  10. object UriConvertible
  11. object io extends RhoDsl[IO]

Deprecated Value Members

  1. 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

  2. implicit def http4sNonEmptyListSyntax[A](l: NonEmptyList[A]): NonEmptyListOps[A]
    Definition Classes
    NonEmptyListSyntax
    Annotations
    @deprecated
    Deprecated

    (Since version 0.18.5) Use cats.foldable._

Inherited from AllSyntax

Inherited from LiteralsSyntax

Inherited from StringSyntax

Inherited from NonEmptyListSyntax

Inherited from KleisliSyntax

Inherited from AsyncSyntax

Inherited from AnyRef

Inherited from Any

Ungrouped