ammonite.main

Router

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
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Router
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

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

    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(name: String, argSignatures: Seq[ArgSig], varargs: Boolean, invoke0: (Map[String, String], Seq[String]) ⇒ Result[Any]) extends Product with Serializable

    What is known about a single endpoint for our routes.

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

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

  5. sealed trait Result[+T] extends AnyRef

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

  6. class doc extends Annotation with StaticAnnotation

  7. class main extends Annotation with StaticAnnotation

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. object Result

  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def clone(): AnyRef

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

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

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

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

    Annotations
    @macroImpl( ... )
  13. def generateRoutesImpl[T](c: Context)(t: scala.reflect.macros.Context.Expr[T])(implicit arg0: scala.reflect.macros.Context.WeakTypeTag[T]): scala.reflect.macros.Context.Expr[Seq[EntryPoint]]

  14. final def getClass(): Class[_]

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

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

    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

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

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

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

    Definition Classes
    AnyRef
  23. def toString(): String

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

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

  26. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped