=docs #18012 complete remaining TODO sections in scala HTTP docs

This commit is contained in:
Mathias 2015-07-17 16:18:18 +02:00
parent cf11eab9ae
commit 1441f201b1
19 changed files with 519 additions and 51 deletions

View file

@ -140,19 +140,7 @@ class HttpExt(config: Config)(implicit system: ActorSystem) extends akka.actor.E
log: LoggingAdapter = system.log)(implicit fm: Materializer): Future[ServerBinding] =
bindAndHandle(Flow[HttpRequest].mapAsync(parallelism)(handler), interface, port, settings, httpsContext, log)
/**
* The type of the server-side HTTP layer as a stand-alone BidiStage
* that can be put atop the TCP layer to form an HTTP server.
*
* {{{
* +------+
* HttpResponse ~>| |~> SslTlsOutbound
* | bidi |
* HttpRequest <~| |<~ SslTlsInbound
* +------+
* }}}
*/
type ServerLayer = BidiFlow[HttpResponse, SslTlsOutbound, SslTlsInbound, HttpRequest, Unit]
type ServerLayer = Http.ServerLayer
/**
* Constructs a [[ServerLayer]] stage using the configured default [[ServerSettings]]. The returned [[BidiFlow]]
@ -207,19 +195,7 @@ class HttpExt(config: Config)(implicit system: ActorSystem) extends akka.actor.E
}
}
/**
* The type of the client-side HTTP layer as a stand-alone BidiStage
* that can be put atop the TCP layer to form an HTTP client.
*
* {{{
* +------+
* HttpRequest ~>| |~> SslTlsOutbound
* | bidi |
* HttpResponse <~| |<~ SslTlsInbound
* +------+
* }}}
*/
type ClientLayer = BidiFlow[HttpRequest, SslTlsOutbound, SslTlsInbound, HttpResponse, Unit]
type ClientLayer = Http.ClientLayer
/**
* Constructs a [[ClientLayer]] stage using the configured default [[ClientConnectionSettings]].
@ -502,6 +478,38 @@ class HttpExt(config: Config)(implicit system: ActorSystem) extends akka.actor.E
object Http extends ExtensionId[HttpExt] with ExtensionIdProvider {
//#server-layer
/**
* The type of the server-side HTTP layer as a stand-alone BidiStage
* that can be put atop the TCP layer to form an HTTP server.
*
* {{{
* +------+
* HttpResponse ~>| |~> SslTlsOutbound
* | bidi |
* HttpRequest <~| |<~ SslTlsInbound
* +------+
* }}}
*/
type ServerLayer = BidiFlow[HttpResponse, SslTlsOutbound, SslTlsInbound, HttpRequest, Unit]
//#
//#client-layer
/**
* The type of the client-side HTTP layer as a stand-alone BidiStage
* that can be put atop the TCP layer to form an HTTP client.
*
* {{{
* +------+
* HttpRequest ~>| |~> SslTlsOutbound
* | bidi |
* HttpResponse <~| |<~ SslTlsInbound
* +------+
* }}}
*/
type ClientLayer = BidiFlow[HttpRequest, SslTlsOutbound, SslTlsInbound, HttpResponse, Unit]
//#
/**
* Represents a prospective HTTP server binding.
*

View file

@ -115,13 +115,23 @@ sealed trait HttpEntity extends jm.HttpEntity {
sealed trait BodyPartEntity extends HttpEntity with jm.BodyPartEntity {
def withContentType(contentType: ContentType): BodyPartEntity
}
/* An entity that can be used for requests */
/**
* An [[HttpEntity]] that can be used for requests.
* Note that all entities that can be used for requests can also be used for responses.
* (But not the other way around, since [[HttpEntity.CloseDelimited]] can only be used for responses!)
*/
sealed trait RequestEntity extends HttpEntity with jm.RequestEntity with ResponseEntity {
def withContentType(contentType: ContentType): RequestEntity
override def transformDataBytes(transformer: Flow[ByteString, ByteString, Any]): RequestEntity
}
/* An entity that can be used for responses */
/**
* An [[HttpEntity]] that can be used for responses.
* Note that all entities that can be used for requests can also be used for responses.
* (But not the other way around, since [[HttpEntity.CloseDelimited]] can only be used for responses!)
*/
sealed trait ResponseEntity extends HttpEntity with jm.ResponseEntity {
def withContentType(contentType: ContentType): ResponseEntity

View file

@ -21,7 +21,7 @@ import akka.http.scaladsl.model.headers._
import akka.http.impl.engine.rendering.BodyPartRenderer
import FastFuture._
trait Multipart {
sealed trait Multipart {
def mediaType: MultipartMediaType
def parts: Source[Multipart.BodyPart, Any]