package routing
- Source
- routing.scala
- Alphabetic
- By Inheritance
- routing
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
sealed
trait
Base64Url extends AnyRef
tags bytes encoded as Base64Url *
- trait BodyHelper[F[_]] extends AnyRef
- trait MatchResult[+F[_], +A] extends AnyRef
- sealed trait Matcher[+F[_], +A] extends AnyRef
- type Route[F[_]] = Matcher[F, Stream[F, HttpResponse[F]]]
-
sealed
trait
StringDecoder[A] extends AnyRef
Decoder for
A
to be decoded from supplied String - implicit final class StringMatcherSyntax extends AnyVal
Value Members
- val Delete: Matcher[Nothing, protocol.http.HttpMethod.Value]
- val Get: Matcher[Nothing, protocol.http.HttpMethod.Value]
- val Options: Matcher[Nothing, protocol.http.HttpMethod.Value]
- val Post: Matcher[Nothing, protocol.http.HttpMethod.Value]
- val Put: Matcher[Nothing, protocol.http.HttpMethod.Value]
-
def
as[A](implicit decoder: StringDecoder[A]): Matcher[Nothing, A]
decodes head of the path to
A
givne supplied decoder from string * -
def
body[F[_]]: BodyHelper[F]
extracts body of the request *
-
def
choice[F[_], A](matcher: Matcher[F, A], matchers: Matcher[F, A]*): Matcher[F, A]
matches any supplied matcher *
-
val
empty: Matcher[Nothing, Unit]
matches if remaining path segments are empty *
-
def
eval[F[_], A](f: F[A]): Matcher[F, A]
Evaluates
f
returning its result as successful matcher -
def
header[H <: HttpHeader](implicit T: Typeable[H]): Matcher[Nothing, H]
matches header of type
h
* -
def
method[F[_]](method: protocol.http.HttpMethod.Value): Matcher[F, protocol.http.HttpMethod.Value]
matches supplied method *
-
def
param[A](key: String)(implicit decoder: StringDecoder[A]): Matcher[Nothing, A]
Matches if query contains
key
and that can be decoded toA
via supplied decoder -
def
paramBase64(key: String, alphabet: Base64Alphabet = Bases.Alphabets.Base64Url): Matcher[Nothing, ByteVector]
Decodes Base64 (Url) encoded binary data in parameter specified by
key
* -
def
path: Matcher[Nothing, Path]
matches to relative path in current context *
-
def
route[F[_]](r: Route[F])(implicit F: Effect[F]): (HttpRequestHeader, Stream[F, Byte]) ⇒ Stream[F, HttpResponse[F]]
converts supplied route to function that is handled over to server to perform the routing *
- implicit def string2RequestMatcher(s: String): Matcher[Nothing, String]
-
def
websocket[F[_], I, O](pingInterval: Duration = 30.seconds, handshakeTimeout: FiniteDuration = 10.seconds, maxFrameSize: Int = 1024*1024)(implicit arg0: Concurrent[F], arg1: Timer[F], arg2: Decoder[I], arg3: Encoder[O]): Match[Nothing, (Pipe[F, Frame[I], Frame[O]]) ⇒ Stream[F, HttpResponse[F]]]
Creates a Matcher that when supplied a pipe will create the websocket connection.
Creates a Matcher that when supplied a pipe will create the websocket connection.
I
is received from the client andO
is sent to client. Decoder (for I) and Encoder (for O) must be supplied.- pingInterval
An interval for the Ping / Pong protocol.
- handshakeTimeout
An timeout to await for handshake to be successfull. If the handshake is not completed within supplied period, connection is terminated.
- maxFrameSize
Maximum size of single websocket frame. If the binary size of single frame is larger than supplied value, websocket will fail.
- object MatchResult
- object Matcher
- object StringDecoder