Trait

endpoints.play.server

Assets

Related Doc: package server

Permalink

trait Assets extends algebra.Assets with Endpoints

Interpreter for algebra.Assets that performs routing using Play framework

Source
Assets.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Assets
  2. Endpoints
  3. StatusCodes
  4. Methods
  5. Urls
  6. Assets
  7. Endpoints
  8. Responses
  9. StatusCodes
  10. Requests
  11. SemigroupalSyntax
  12. PartialInvariantFunctorSyntax
  13. InvariantFunctorSyntax
  14. Methods
  15. Urls
  16. AnyRef
  17. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. implicit final class ApplicativeMapSyntax[F[_], A] extends AnyRef

    Permalink
    Definition Classes
    Urls
  2. case class AssetPath(path: Seq[String], digest: String, name: String) extends Product with Serializable

    Permalink

    // foo/bar/baz-123abc
    AssetPath("foo" :: "bar" :: Nil, "123abc", "baz")
  3. case class AssetRequest(assetPath: AssetPath, isGzipSupported: Boolean) extends Product with Serializable

    Permalink

    assetPath

    Path of the requested asset

    isGzipSupported

    Whether the client supports gzip encoding or not

  4. sealed trait AssetResponse extends AnyRef

    Permalink

    An AssetResponse is either AssetNotFound (if the asset has not been found on the server) or Found otherwise.

  5. case class Endpoint[A, B](request: Request[A], response: Response[B]) extends Product with Serializable

    Permalink

    Concrete representation of an Endpoint for routing purpose.

    Concrete representation of an Endpoint for routing purpose.

    Definition Classes
    Endpoints
  6. case class EndpointWithHandler[A, B](endpoint: Endpoint[A, B], service: (A) ⇒ Future[B]) extends ToPlayHandler with Product with Serializable

    Permalink

    An endpoint from which we can get a Play request handler.

    An endpoint from which we can get a Play request handler.

    Definition Classes
    Endpoints
  7. case class Found(data: Source[ByteString, _], contentLength: Option[Long], contentType: Option[String], isGzipped: Boolean) extends AssetResponse with Product with Serializable

    Permalink

    data

    Asset content

    contentLength

    Size, if known

    contentType

    Content type, if known

    isGzipped

    Whether data contains the gzipped version of the asset

  8. implicit class InvariantFunctorSyntax[A, F[_]] extends AnyRef

    Permalink
    Definition Classes
    InvariantFunctorSyntax
  9. case class Method(value: String) extends Product with Serializable

    Permalink
    Definition Classes
    Methods
  10. implicit class PartialInvariantFunctorSyntax[A, F[_]] extends AnyRef

    Permalink
    Definition Classes
    PartialInvariantFunctorSyntax
  11. trait Path[A] extends Url[A]

    Permalink
    Definition Classes
    Urls
  12. implicit class PathOps[A] extends AnyRef

    Permalink
    Definition Classes
    Urls
  13. trait QueryString[A] extends AnyRef

    Permalink

    Query string encoding and decoding

    Query string encoding and decoding

    Definition Classes
    Urls
  14. implicit class QueryStringOps[A] extends AnyRef

    Permalink
    Definition Classes
    Urls
  15. trait QueryStringParam[A] extends AnyRef

    Permalink
    Definition Classes
    Urls
  16. trait Request[A] extends AnyRef

    Permalink

    An HTTP request.

    An HTTP request.

    Has an instance of InvariantFunctor.

    Definition Classes
    Endpoints
  17. type RequestEntity[A] = BodyParser[A]

    Permalink

    Decodes a request entity

    Decodes a request entity

    Definition Classes
    Endpoints → Requests
  18. type RequestExtractor[A] = (RequestHeader) ⇒ Option[A]

    Permalink

    Convenient type alias modeling the extraction of an A information from request headers.

    Convenient type alias modeling the extraction of an A information from request headers.

    This type has an instance of Applicative.

    Definition Classes
    Urls
  19. type RequestHeaders[A] = (Headers) ⇒ Either[Result, A]

    Permalink

    An attempt to extract an A from a request headers.

    An attempt to extract an A from a request headers.

    Models failure by returning a Left(result). That makes it possible to early return an HTTP response if a header is wrong (e.g. if an authentication information is missing)

    Definition Classes
    Endpoints → Requests
  20. type Response[A] = (A) ⇒ Result

    Permalink

    Turns the A information into a proper Play Result

    Turns the A information into a proper Play Result

    Definition Classes
    Endpoints → Responses
  21. implicit class ResponseExtensions[A] extends AnyRef

    Permalink
    Definition Classes
    Responses
  22. trait Segment[A] extends AnyRef

    Permalink

    Defines how to decode and encode path segments

    Defines how to decode and encode path segments

    Definition Classes
    Urls
  23. implicit class SemigroupalSyntax[A, F[_]] extends AnyRef

    Permalink
    Definition Classes
    SemigroupalSyntax
  24. type StatusCode = play.api.mvc.Results.Status

    Permalink
    Definition Classes
    StatusCodes → StatusCodes
  25. trait ToPlayHandler extends AnyRef

    Permalink

    Something that can be used as a Play request handler

    Something that can be used as a Play request handler

    Definition Classes
    Endpoints
  26. trait Url[A] extends AnyRef

    Permalink
    Definition Classes
    Urls
  27. trait UrlAndHeaders[A] extends AnyRef

    Permalink

    The URL and HTTP headers of a request.

    The URL and HTTP headers of a request.

    Definition Classes
    Endpoints

Abstract Value Members

  1. abstract def digests: Map[String, String]

    Permalink
    Definition Classes
    Assets
  2. abstract val playComponents: PlayComponents

    Permalink
    Attributes
    protected
    Definition Classes
    Endpoints

Concrete 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 AssetNotFound extends AssetResponse with Product with Serializable

    Permalink
  5. def BadRequest: play.api.mvc.Results.Status

    Permalink
    Definition Classes
    StatusCodes → StatusCodes
  6. def Delete: Method

    Permalink
    Definition Classes
    Methods → Methods
  7. implicit def EmptyEndpointToPlayHandler[A, B](endpoint: Endpoint[A, B])(implicit ev: =:=[Unit, B]): ToPlayHandler

    Permalink
    Definition Classes
    Endpoints
  8. def Get: Method

    Permalink
    Definition Classes
    Methods → Methods
  9. def NotFound: play.api.mvc.Results.Status

    Permalink
    Definition Classes
    StatusCodes → StatusCodes
  10. def OK: play.api.mvc.Results.Status

    Permalink
    Definition Classes
    StatusCodes → StatusCodes
  11. def Options: Method

    Permalink
    Definition Classes
    Methods → Methods
  12. def Patch: Method

    Permalink
    Definition Classes
    Methods → Methods
  13. def Post: Method

    Permalink
    Definition Classes
    Methods → Methods
  14. def Put: Method

    Permalink
    Definition Classes
    Methods → Methods
  15. def Unauthorized: play.api.mvc.Results.Status

    Permalink
    Definition Classes
    StatusCodes → StatusCodes
  16. implicit lazy val applicativeRequestExtractor: Applicative[RequestExtractor]

    Permalink
    Definition Classes
    Urls
  17. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  18. def asset(path: String, name: String): AssetRequest

    Permalink

    Convenient constructor for building an asset from its name and path, without providing its digest.

    Convenient constructor for building an asset from its name and path, without providing its digest.

    Useful for reverse routing:

    myAssetsEndpoint.call(asset("foo/bar", "baz"))
    path

    Asset path (no leading nor trailing slash)

    name

    Asset name

    returns

    An AssetRequest describing the asset. Throws an exception if there is no digest for name.

  19. def asset(name: String): AssetRequest

    Permalink

    Convenient constructor for building an asset from its name, without providing its digest.

    Convenient constructor for building an asset from its name, without providing its digest.

    Useful for reverse routing:

    myAssetsEndpoint.call(asset("baz"))
    name

    Asset name

    returns

    An AssetRequest describing the asset. There is no path prefixing the name. Throws an exception if there is no digest for name.

  20. def assetSegments(name: String, docs: Documentation): Path[AssetPath]

    Permalink

    Decodes and encodes an AssetPath into a URL path.

    Decodes and encodes an AssetPath into a URL path.

    Definition Classes
    Assets → Assets
  21. def assetsEndpoint(url: Url[AssetPath], docs: Documentation, notFoundDocs: Documentation): Endpoint[AssetRequest, AssetResponse]

    Permalink

    An endpoint for serving assets.

    An endpoint for serving assets.

    url

    URL description

    returns

    An HTTP endpoint serving assets

    Definition Classes
    Assets → Assets
  22. def assetsResources(pathPrefix: Option[String] = None): (AssetRequest) ⇒ AssetResponse

    Permalink

    pathPrefix

    Prefix to use to look up the resources in the classpath. You most probably never want to publish all your classpath resources.

    returns

    A function that, given an AssetRequest, builds an AssetResponse by looking for the requested asset in the classpath resources.

  23. implicit def booleanQueryString: QueryStringParam[Boolean]

    Permalink
    Definition Classes
    Urls
  24. def chainPaths[A, B](first: Path[A], second: Path[B])(implicit tupler: Tupler[A, B]): Path[Out]

    Permalink
    Definition Classes
    Urls → Urls
  25. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. def combineQueryStrings[A, B](first: QueryString[A], second: QueryString[B])(implicit tupler: Tupler[A, B]): QueryString[Out]

    Permalink
    Definition Classes
    Urls → Urls
  27. final def delete[UrlP, HeadersP, Out](url: Url[UrlP], headers: RequestHeaders[HeadersP])(implicit tuplerUH: Tupler.Aux[UrlP, HeadersP, Out]): Request[Out]

    Permalink
    Definition Classes
    Requests
  28. implicit def doubleQueryString: QueryStringParam[Double]

    Permalink
    Definition Classes
    Urls
  29. implicit def doubleSegment: Segment[Double]

    Permalink
    Definition Classes
    Urls
  30. implicit def dummyPathToUrl[A](p: Path[A]): Url[A]

    Permalink
    Definition Classes
    Urls
  31. lazy val emptyHeaders: RequestHeaders[Unit]

    Permalink

    Always succeeds in extracting no information from the headers

    Always succeeds in extracting no information from the headers

    Definition Classes
    Endpoints → Requests
  32. lazy val emptyRequest: BodyParser[Unit]

    Permalink
    Definition Classes
    Endpoints → Requests
  33. def emptyResponse(docs: Documentation): Response[Unit]

    Permalink

    A successful HTTP response (status code 200) with no entity

    A successful HTTP response (status code 200) with no entity

    Definition Classes
    Endpoints → Responses
  34. def endpoint[A, B](request: Request[A], response: Response[B], summary: Documentation, description: Documentation, tags: List[String]): Endpoint[A, B]

    Permalink
    Definition Classes
    Endpoints → Endpoints
  35. final def eq(arg0: AnyRef): Boolean

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  38. implicit lazy val functorRequestExtractor: Functor[RequestExtractor]

    Permalink
    Definition Classes
    Urls
  39. final def get[UrlP, HeadersP, Out](url: Url[UrlP], headers: RequestHeaders[HeadersP])(implicit tuplerUH: Tupler.Aux[UrlP, HeadersP, Out]): Request[Out]

    Permalink
    Definition Classes
    Requests
  40. final def getClass(): Class[_]

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

    Permalink
    Definition Classes
    AnyRef → Any
  42. def header(name: String, docs: Option[String]): (Headers) ⇒ Either[Result, String]

    Permalink
    Definition Classes
    Endpoints → Requests
  43. lazy val htmlResponse: Response[Html]

    Permalink

    A successful HTTP response (status code 200) with an HTML entity

    A successful HTTP response (status code 200) with an HTML entity

    Definition Classes
    Endpoints
  44. implicit def intQueryString: QueryStringParam[Int]

    Permalink
    Definition Classes
    Urls
  45. implicit def intSegment: Segment[Int]

    Permalink
    Definition Classes
    Urls
  46. implicit lazy val invariantFunctorRequest: play.api.libs.functional.InvariantFunctor[Request]

    Permalink
    Definition Classes
    Endpoints
  47. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  48. implicit def longQueryString: QueryStringParam[Long]

    Permalink
    Definition Classes
    Urls
  49. implicit def longSegment: Segment[Long]

    Permalink
    Definition Classes
    Urls
  50. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  53. def optHeader(name: String, docs: Option[String]): (Headers) ⇒ Either[Result, Option[String]]

    Permalink
    Definition Classes
    Endpoints → Requests
  54. implicit def optionalQueryStringParam[A](implicit param: QueryStringParam[A]): QueryStringParam[Option[A]]

    Permalink
    Definition Classes
    Urls → Urls
  55. val path: Path[Unit]

    Permalink
    Definition Classes
    Urls
  56. implicit lazy val pathPartialInvariantFunctor: PartialInvariantFunctor[Path]

    Permalink
    Definition Classes
    Urls → Urls
  57. final def post[UrlP, BodyP, HeadersP, UrlAndBodyPTupled, Out](url: Url[UrlP], entity: RequestEntity[BodyP], headers: RequestHeaders[HeadersP])(implicit tuplerUB: Tupler.Aux[UrlP, BodyP, UrlAndBodyPTupled], tuplerUBH: Tupler.Aux[UrlAndBodyPTupled, HeadersP, Out]): Request[Out]

    Permalink
    Definition Classes
    Requests
  58. final def put[UrlP, BodyP, HeadersP, UrlAndBodyPTupled, Out](url: Url[UrlP], entity: RequestEntity[BodyP], headers: RequestHeaders[HeadersP])(implicit tuplerUB: Tupler.Aux[UrlP, BodyP, UrlAndBodyPTupled], tuplerUBH: Tupler.Aux[UrlAndBodyPTupled, HeadersP, Out]): Request[Out]

    Permalink
    Definition Classes
    Requests
  59. def qs[A](name: String, docs: Documentation)(implicit value: QueryStringParam[A]): QueryString[A]

    Permalink
    Definition Classes
    Urls → Urls
  60. implicit lazy val queryStringParamPartialInvFunctor: PartialInvariantFunctor[QueryStringParam]

    Permalink
    Definition Classes
    Urls → Urls
  61. implicit lazy val queryStringPartialInvFunctor: PartialInvariantFunctor[QueryString]

    Permalink
    Definition Classes
    Urls → Urls
  62. def redirect[A](other: ⇒ Endpoint[A, _])(args: A): Response[Unit]

    Permalink

    other

    Endpoint to redirect to

    args

    Arguments to pass to the endpoint to generate its URL

    returns

    An HTTP response redirecting to another endpoint (using 303 code status).

    Definition Classes
    Endpoints
  63. def remainingSegments(name: String, docs: Documentation): Path[String]

    Permalink
    Definition Classes
    Urls → Urls
  64. implicit def repeatedQueryStringParam[A, CC[X] <: Iterable[X]](implicit param: QueryStringParam[A], factory: scala.collection.compat.Factory[A, CC[A]]): QueryStringParam[CC[A]]

    Permalink
    Definition Classes
    Urls → Urls
  65. implicit def reqEntityInvFunctor: InvariantFunctor[RequestEntity]

    Permalink
    Definition Classes
    Endpoints → Requests
  66. implicit lazy val reqHeadersInvFunctor: InvariantFunctor[RequestHeaders]

    Permalink
    Definition Classes
    Endpoints → Requests
  67. implicit lazy val reqHeadersSemigroupal: Semigroupal[RequestHeaders]

    Permalink
    Definition Classes
    Endpoints → Requests
  68. def request[A, B, C, AB, Out](method: Method, url: Url[A], entity: RequestEntity[B], headers: RequestHeaders[C])(implicit tuplerAB: Tupler.Aux[A, B, AB], tuplerABC: Tupler.Aux[AB, C, Out]): Request[Out]

    Permalink

    Decodes a request that uses the POST HTTP verb.

    Decodes a request that uses the POST HTTP verb.

    url

    Request URL

    entity

    Request entity

    headers

    Request headers

    Definition Classes
    Endpoints → Requests
  69. def routesFromEndpoints(endpoints: ToPlayHandler*): PartialFunction[RequestHeader, Handler]

    Permalink

    Builds a Play router out of endpoint definitions.

    Builds a Play router out of endpoint definitions.

    val routes = routesFromEndpoints(
      inc.implementedBy(x => x + 1)
    )
    Definition Classes
    Endpoints
  70. def segment[A](name: String, docs: Documentation)(implicit A: Segment[A]): Path[A]

    Permalink
    Definition Classes
    Urls → Urls
  71. implicit lazy val segmentPartialInvFunctor: PartialInvariantFunctor[Segment]

    Permalink
    Definition Classes
    Urls → Urls
  72. def staticPathSegment(segment: String): Path[Unit]

    Permalink
    Definition Classes
    Urls → Urls
  73. implicit lazy val stringQueryString: QueryStringParam[String]

    Permalink
    Definition Classes
    Urls → Urls
  74. implicit def stringSegment: Segment[String]

    Permalink
    Definition Classes
    Urls → Urls
  75. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  76. def textRequest(docs: Documentation): BodyParser[String]

    Permalink
    Definition Classes
    Endpoints → Requests
  77. def textResponse(docs: Documentation): Response[String]

    Permalink

    A successful HTTP response (status code 200) with string entity

    A successful HTTP response (status code 200) with string entity

    Definition Classes
    Endpoints → Responses
  78. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  79. implicit lazy val urlPartialInvFunctor: PartialInvariantFunctor[Url]

    Permalink
    Definition Classes
    Urls → Urls
  80. def urlWithQueryString[A, B](path: Path[A], qs: QueryString[B])(implicit tupler: Tupler[A, B]): Url[Out]

    Permalink
    Definition Classes
    Urls → Urls
  81. val utf8Name: String

    Permalink
    Definition Classes
    Urls
  82. implicit def uuidQueryString: QueryStringParam[UUID]

    Permalink
    Definition Classes
    Urls
  83. implicit def uuidSegment: Segment[UUID]

    Permalink
    Definition Classes
    Urls
  84. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  87. def wheneverFound[A](response: Response[A], notFoundDocs: Documentation): Response[Option[A]]

    Permalink

    A response encoder that maps None to an empty HTTP result with status 404

    A response encoder that maps None to an empty HTTP result with status 404

    Definition Classes
    Endpoints → Responses

Inherited from Endpoints

Inherited from StatusCodes

Inherited from Methods

Inherited from Urls

Inherited from algebra.Assets

Inherited from algebra.Endpoints

Inherited from Responses

Inherited from algebra.StatusCodes

Inherited from Requests

Inherited from algebra.Methods

Inherited from algebra.Urls

Inherited from AnyRef

Inherited from Any

Ungrouped