cask.router

package cask.router

Type members

Classlikes

trait ArgReader[I, +T, -C]
case class ArgSig[I, -T, +V, -C](name: String, typeString: String, doc: Option[String], default: Option[T => V])(implicit reads: ArgReader[I, V, C])

Models what is known by the router about a single argument: that it has a name, a human-readable typeString describing what the type is (just for logging and reading, not a replacement for a TypeTag) and possible a function that can compute its default value

Models what is known by the router about a single argument: that it has a name, a human-readable typeString describing what the type is (just for logging and reading, not a replacement for a TypeTag) and possible a function that can compute its default value

trait Decorator[OuterReturned, InnerReturned, Input] extends Annotation

A Decorator allows you to annotate a function to wrap it, via wrapFunction. You can use this to perform additional validation before or after the function runs, provide an additional parameter list of params, open/commit/rollback database transactions before/after the function runs, or even retrying the wrapped function if it fails.

A Decorator allows you to annotate a function to wrap it, via wrapFunction. You can use this to perform additional validation before or after the function runs, provide an additional parameter list of params, open/commit/rollback database transactions before/after the function runs, or even retrying the wrapped function if it fails.

Calls to the wrapped function are done on the delegate parameter passed to wrapFunction, which takes a Map representing any additional argument lists (if any).

Companion:
object
object Decorator
Companion:
class
trait Endpoint[OuterReturned, InnerReturned, Input] extends Decorator[OuterReturned, InnerReturned, Input]

An HttpEndpoint that may return something else than a HTTP response, e.g. a websocket endpoint which may instead return a websocket event handler

An HttpEndpoint that may return something else than a HTTP response, e.g. a websocket endpoint which may instead return a websocket event handler

case class EndpointMetadata[T](decorators: Seq[Decorator[_, _, _]], endpoint: Endpoint[_, _, _], entryPoint: EntryPoint[T, _])
Companion:
object
Companion:
class
case class EntryPoint[T, C](name: String, argSignatures: Seq[Seq[ArgSig[_, T, _, C]]], doc: Option[String], invoke0: (T, C, Seq[Map[String, Any]], Seq[Seq[ArgSig[Any, _, _, C]]]) => Result[Any])

What is known about a single endpoint for our routes. It has a name, argSignatures for each argument, and a macro-generated invoke0 that performs all the necessary argument parsing and de-serialization.

What is known about a single endpoint for our routes. It has a name, argSignatures for each argument, and a macro-generated invoke0 that performs all the necessary argument parsing and de-serialization.

Realistically, you will probably spend most of your time calling invoke instead, which provides a nicer API to call it that mimmicks the API of calling a Scala method.

trait HttpEndpoint[InnerReturned, Input] extends Endpoint[Raw, InnerReturned, Input]

Annotates a Cask endpoint that returns a HTTP Response; similar to a RawDecorator but with additional metadata and capabilities.

Annotates a Cask endpoint that returns a HTTP Response; similar to a RawDecorator but with additional metadata and capabilities.

object Macros
class NoOpParser[Input, T] extends ArgReader[Input, T, Request]
Companion:
object
object NoOpParser
Companion:
class
trait RawDecorator extends Decorator[Raw, Raw, Any]

A RawDecorator is a decorator that operates on the raw request and response stream, before and after the primary Endpoint does it's job.

A RawDecorator is a decorator that operates on the raw request and response stream, before and after the primary Endpoint does it's job.

sealed trait Result[+T]

Represents what comes out of an attempt to invoke an EntryPoint. Could succeed with a value, but could fail in many different ways.

Represents what comes out of an attempt to invoke an EntryPoint. Could succeed with a value, but could fail in many different ways.

Companion:
object
object Result
Companion:
class
case class RoutesEndpointsMetadata[T](value: Seq[EndpointMetadata[T]])
Companion:
object
object Runtime
class doc(s: String) extends StaticAnnotation