Encapsulation of metadata and a result generator
Encapsulation of metadata and a result generator
The type of HList
required to execute the Action.
Information about the status and type the Action will produce.
Encodings that the response supports.
Function of Request
and the HList
to a Task[Response]
The AuthedContext provides a convenient way to define a RhoService which works with http4s authentication middleware.
The AuthedContext provides a convenient way to define a RhoService which works with http4s authentication middleware.
case class User(name: String, id: UUID) object Auth { val authUser: Service[Request, User] = Kleisli({ _ => Task.now(User("Test User", UUID.randomUUID())) }) val authenticated = AuthMiddleware(authUser) } object MyAuth extends AuthedContext[User] object MyService extends RhoService { import MyAuth._ GET +? param("foo", "bar") |>> { (req: Request, foo: String) => val user = getAuth(req) if (user.name == "Test User") { Ok(s"just root with parameter 'foo=$foo'") } else { BadRequest("This should not have happened.") } } } val service = Auth.authenticated(MyAuth.toService(MyService.toService(SwaggerSupport())))
authInfo type for this service.
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.
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.
Fully functional path building
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.
The HList representation of the types the route expects to extract
from a Request
.
Request method to match.
Path rules to execute.
Accumulated RequestRule's.
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.
The HList
representation of the values to be extracted from the Request
.
A helper for capturing the result types and status codes from routes
A type to bundle everything needed to define a route
Constructor class for defining routes
Constructor class for defining routes
The RhoService provides a convenient way to define routes in a style similar to scalatra etc by providing implicit conversions and an implicit CompileService inside the constructor.
val srvc = new RhoService { POST / "foo" / pathVar[Int] +? param[String]("param") |>> { (p1: Int, param: String) => Ok("success") } }
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.
The HList
representation of the types the route expects to extract
from a Request
.
Types that extends this trait can be prepended with noncapturing paths
Provides the operations for generating a router
Provides the operations for generating a router
cumulative type of the required method for executing the router
request methods to match
path matching stack
header validation stack
CompileService which accumulates routes and can build a HttpService
A typed shell which represents the requirements of the route
A typed shell which represents the requirements of the route
The HList
representation of the values to be extracted from the Request
.
Defines a type that is convertible into an Uri
or UriTemplate
(Since version 0.18.0-M2) Use map or flatMap directly on the request
(Since version 0.18.0-M2) Use map or flatMap directly on the response