Object/Class

ammonite.main

Router

Related Docs: class Router | package main

Permalink

object Router

More or less a minimal version of Autowire's Server that lets you generate a set of "routes" from the methods defined in an object, and call them using passing in name/args/kwargs via Java reflection, without having to generate/compile code or use Scala reflection. This saves us spinning up the Scala compiler and greatly reduces the startup time of cached scripts.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Router
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. case class ArgSig[T](name: String, typeString: String, doc: Option[String], default: Option[(T) ⇒ Any]) extends Product with Serializable

    Permalink

    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

  2. case class EntryPoint[T](name: String, argSignatures: Seq[ArgSig[T]], doc: Option[String], varargs: Boolean, invoke0: (T, Map[String, String], Seq[String]) ⇒ Result[Any], overrides: Int) extends Product with Serializable

    Permalink

    What is known about a single endpoint for our routes.

    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.

  3. type FailAll = Either[Seq[ParamError], Seq[Any]]

    Permalink
  4. type FailMaybe = Either[Seq[ParamError], Any]

    Permalink
  5. case class Overrides(value: Int) extends Product with Serializable

    Permalink

    Allows you to query how many things are overridden by the enclosing owner.

  6. sealed trait Result[+T] extends AnyRef

    Permalink

    Represents what comes out of an attempt to invoke an EntryPoint.

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

  7. class doc extends Annotation with StaticAnnotation

    Permalink
  8. class main extends Annotation with StaticAnnotation

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. object Overrides extends Serializable

    Permalink
  5. object Result

    Permalink
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. macro def generateRoutes[T]: Seq[EntryPoint[T]]

    Permalink
  12. def generateRoutesImpl[T](c: Context)(implicit arg0: scala.reflect.macros.blackbox.Context.WeakTypeTag[T]): scala.reflect.macros.blackbox.Context.Expr[Seq[EntryPoint[T]]]

    Permalink
  13. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  14. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  15. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  16. def makeReadCall[T](dict: Map[String, String], default: ⇒ Option[Any], arg: ArgSig[_])(implicit arg0: Read[T]): FailMaybe

    Permalink
  17. def makeReadVarargsCall[T](arg: ArgSig[_], values: Seq[String])(implicit arg0: Read[T]): Product with Serializable with Either[Seq[ParamError], Seq[T]]

    Permalink
  18. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  19. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. def read[T](dict: Map[String, String], default: ⇒ Option[Any], arg: ArgSig[_], thunk: (String) ⇒ T): FailMaybe

    Permalink
  22. def readVarargs[T](arg: ArgSig[_], values: Seq[String], thunk: (String) ⇒ T): Product with Serializable with Either[Seq[ParamError], Seq[T]]

    Permalink
  23. def stripDashes(s: String): String

    Permalink
  24. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  25. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  26. def tryEither[T](t: ⇒ T, error: (Throwable) ⇒ ParamError): Product with Serializable with Either[ParamError, T]

    Permalink
  27. def validate(args: Seq[FailMaybe]): Result[Seq[Any]]

    Permalink
  28. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped