package http
- Alphabetic
- By Inheritance
- http
- RouteDecoderModule
- RequestSyntax
- PathSyntax
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- final case class Cookie(name: String, content: String, expires: Option[Instant] = None, domain: Option[String] = None, path: Option[Path] = None, isSecure: Boolean = false, isHttpOnly: Boolean = false, maxAge: Option[Long] = None, sameSite: Option[SameSite] = None, secret: Option[String] = None) extends Product with Serializable
- type Header = (CharSequence, CharSequence)
-
final
case class
Headers(toChunk: Chunk[Header]) extends HeaderExtension[Headers] with Product with Serializable
Represents an immutable collection of headers i.e.
Represents an immutable collection of headers i.e. essentially a Chunk[(String, String)]. It extends HeaderExtensions and has a ton of powerful operators that can be used to add, remove and modify headers.
NOTE: Generic operators that are not specific to
Headersshould not be defined here. A better place would be one of the traits extended byHeaderExtension. -
sealed
trait
Http[-R, +E, -A, +B] extends (A) ⇒ ZIO[R, Option[E], B]
A functional domain to model Http apps using ZIO and that can work over any kind of request and response types.
- type HttpApp[-R, +E] = Http[R, E, Request, Response]
-
sealed
trait
HttpData extends AnyRef
Holds HttpData that needs to be written on the HttpChannel
- sealed abstract class HttpError extends Throwable
-
sealed
trait
IsMono[-AIn, +BIn, +AOut, -BOut] extends AnyRef
IsMono is a type-constraint that is used by the middleware api for allowing some operators only when the following condition is met.
IsMono is a type-constraint that is used by the middleware api for allowing some operators only when the following condition is met.
Condition: Since a middleware takes in an Http and returns a new Http, IsMono, makes sure that the type parameters of the incoming Http and the ones for the outgoing Http is the same.
For Eg: IsMono will be defined for a middleware that looks as follows
val mid: Middleware[Any, Nothing, Request, Response, Request, Response]This is because both the middleware is defined from (Request, Response) => (Request, Response). Consider another example:
val mid: Middleware[Any, Nothing, Request, Response, UserRequest, UserResponse]In this case, the incoming and outgoing types are different viz. (Request, Response) => (UserRequest, UserResponse), hence there is no IsMono defined for such middlewares.
- Annotations
- @implicitNotFound( ... )
- final case class MediaType(mainType: String, subType: String, compressible: Boolean = false, binary: Boolean = false, fileExtensions: List[String] = Nil, extensions: Map[String, String] = Map.empty) extends Product with Serializable
- sealed trait Method extends AnyRef
-
trait
Middleware[-R, +E, +AIn, -BIn, -AOut, +BOut] extends AnyRef
Middlewares are essentially transformations that one can apply on any Http to produce a new one.
Middlewares are essentially transformations that one can apply on any Http to produce a new one. They can modify requests and responses and also transform them into more concrete domain entities.
You can think of middlewares as a functions —
type Middleware[R, E, AIn, BIn, AOut, BOut] = Http[R, E, AIn, BIn] => Http[R, E, AOut, BOut]
The
AInandBIntype params represent the type params of the input Http. TheAOutandBOuttype params represent the type params of the output Http. -
sealed
trait
Patch extends AnyRef
Models the set of operations that one would want to apply on a Response.
-
final
case class
Path extends Product with Serializable
Path is an immutable representation of a urls path.
Path is an immutable representation of a urls path. Internally it stores each element of a path in a sequence of
Segment. This allows for powerful compositional APIs. -
final
case class
Proxy(url: URL, credentials: Option[Credentials] = None, headers: Headers = Headers.empty) extends Product with Serializable
Represents the connection to the forward proxy before running the request
- type RHttpApp[-R] = Http[R, Throwable, Request, Response]
- trait Request extends HeaderExtension[Request] with HttpDataExtension[Request]
- final case class Response extends HeaderExtension[Response] with HttpDataExtension[Response] with Product with Serializable
- type ResponseZIO[-R, +E] = ZIO[R, E, Response]
-
trait
RouteDecoderModule extends AnyRef
Instead of using just
Stringas path params, using the RouteDecoderModule we can extract and converted params into a specific type also.Instead of using just
Stringas path params, using the RouteDecoderModule we can extract and converted params into a specific type also.scala Http.collect[Request] { case GET -> !! / "user" / int(id) => Response.text("User id requested: ${id}") case GET -> !! / "user" / name => Response.text("User name requested: ${name}") }If the request looks like
GET /user/100then it would match the first case. This is because internally theidparam can be decoded into anInt. If a request of the formGET /user/ziois made, in that case the second case is matched. -
abstract
class
RouteDecode[A] extends AnyRef
- Definition Classes
- RouteDecoderModule
- sealed trait Scheme extends AnyRef
- sealed trait Status extends Product with Serializable
- type UHttp[-A, +B] = Http[Any, Nothing, A, B]
- type UHttpApp = Http[Any, Nothing, Request, Response]
- type UMiddleware[+AIn, -BIn, -AOut, +BOut] = Middleware[Any, Nothing, AIn, BIn, AOut, BOut]
- final case class URL(path: Path, kind: Location = URL.Location.Relative, queryParams: Map[String, List[String]] = Map.empty, fragment: Option[Fragment] = None) extends Product with Serializable
- sealed trait Version extends AnyRef
Value Members
-
val
!!: Path
- Definition Classes
- PathSyntax
-
val
HTTP_CHARSET: Charset
Default HTTP Charset
-
val
~~: Path
- Definition Classes
- PathSyntax
-
object
->
- Definition Classes
- RequestSyntax
-
object
/
- Definition Classes
- PathSyntax
-
object
/:
- Definition Classes
- PathSyntax
- object Cookie extends Serializable
- object HExit
- object HeaderNames extends HeaderNames
- object HeaderValues extends HeaderValues
- object Headers extends HeaderConstructors with Serializable
- object Http
- object HttpData
- object HttpError extends Serializable
- object IsMono extends IsMono[Any, Nothing, Nothing, Any]
- object MediaType extends MimeDB with Serializable
- object Method
- object Middleware extends Web
- object Patch
- object Path extends Serializable
- object Proxy extends Serializable
- object Request
- object Response extends Serializable
-
object
boolean extends RouteDecode[Boolean]
- Definition Classes
- RouteDecoderModule
-
object
byte extends RouteDecode[Byte]
- Definition Classes
- RouteDecoderModule
-
object
date extends RouteDecode[LocalDate]
- Definition Classes
- RouteDecoderModule
-
object
double extends RouteDecode[Double]
- Definition Classes
- RouteDecoderModule
-
object
float extends RouteDecode[Float]
- Definition Classes
- RouteDecoderModule
-
object
int extends RouteDecode[Int]
- Definition Classes
- RouteDecoderModule
-
object
long extends RouteDecode[Long]
- Definition Classes
- RouteDecoderModule
-
object
short extends RouteDecode[Short]
- Definition Classes
- RouteDecoderModule
-
object
time extends RouteDecode[LocalDateTime]
- Definition Classes
- RouteDecoderModule
-
object
uuid extends RouteDecode[UUID]
- Definition Classes
- RouteDecoderModule
- object Scheme
- object Status extends Serializable
- object URL extends Serializable
- object Version