endpoints.algebra

Urls

trait Urls extends AnyRef

Algebra interface for describing URLs made of a path and a query string.

A path is itself made of segments chained together.

A query string is made of named parameters.

/**
* Describes an URL starting with a segment containing ¬タワarticles¬タン, followed
* by another `String` segment, and a query string containing
* a mandatory `Lang` parameter named ¬タワlang¬タン, and an
* optional `Int` parameter named ¬タワpage¬タン.
*
* Examples of matching URLs:
*
* - /articles/kitchen?lang=fr
* - /articles/garden?lang=en&page=2
*/  *   val example = path / "articles" / segment[String] /? (qs[Lang]("lang") & optQs[Int]("page"))
Source
Urls.scala
Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Urls
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. abstract type Path[A] <: Url[A]

    An URL path carrying an A information

  2. implicit class PathOps[A] extends AnyRef

    Convenient methods for Paths.

  3. abstract type QueryString[A]

    A query string carrying an A information

  4. implicit class QueryStringOps[A] extends AnyRef

    Provides convenient methods on QueryString.

  5. abstract type QueryStringParam[A]

    A single query string parameter carrying an A information.

  6. abstract type Segment[A]

    An URL path segment carrying an A information.

  7. abstract type Url[A]

    An URL carrying an A information

Abstract Value Members

  1. abstract def chainPaths[A, B](first: Path[A], second: Path[B])(implicit tupler: Tupler[A, B]): Path[Out]

    Chains the two paths

  2. abstract def combineQueryStrings[A, B](first: QueryString[A], second: QueryString[B])(implicit tupler: Tupler[A, B]): QueryString[Out]

    Concatenates two QueryStrings

  3. implicit abstract def intQueryString: QueryStringParam[Int]

    Ability to define Int query string parameters

  4. implicit abstract def intSegment: Segment[Int]

    Ability to define Int path segments

  5. implicit abstract def longQueryString: QueryStringParam[Long]

    Query string parameter containing a Long value

  6. implicit abstract def longSegment: Segment[Long]

    Segment containing a Long value

  7. abstract def optQs[A](name: String, docs: Documentation = None)(implicit value: QueryStringParam[A]): QueryString[Option[A]]

    Builds a QueryString with one optional parameter of type A.

    Builds a QueryString with one optional parameter of type A.

    name

    Parameter’s name

  8. abstract def qs[A](name: String, docs: Documentation = None)(implicit value: QueryStringParam[A]): QueryString[A]

    Builds a QueryString with one parameter.

    Builds a QueryString with one parameter.

    A

    Type of the value carried by the parameter

    name

    Parameter’s name

  9. abstract def segment[A](name: String = "", docs: Documentation = None)(implicit s: Segment[A]): Path[A]

    Builds a path segment carrying an A information

  10. abstract def staticPathSegment(segment: String): Path[Unit]

    Builds a static path segment

  11. implicit abstract def stringQueryString: QueryStringParam[String]

    Ability to define String query string parameters

  12. implicit abstract def stringSegment: Segment[String]

    Ability to define String path segments

  13. implicit abstract def urlInvFunctor: InvariantFunctor[Url]

  14. abstract def urlWithQueryString[A, B](path: Path[A], qs: QueryString[B])(implicit tupler: Tupler[A, B]): Url[Out]

    Builds an URL from the given path and query string

Concrete 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. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. implicit def dummyPathToUrl[A](p: Path[A]): Url[A]

    Implicit conversion to get rid of intellij errors when defining paths.

    Implicit conversion to get rid of intellij errors when defining paths. Effectively should not be called.

  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. final def getClass(): Class[_]

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

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

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

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

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

    Definition Classes
    AnyRef
  18. val path: Path[Unit]

    An empty path.

    An empty path.

    Useful to begin a path definition:

    path / "foo" / segment[Int] /? qs[String]("bar")
  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  20. def toString(): String

    Definition Classes
    AnyRef → Any
  21. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped