wvlet.airframe.http

Attributes

Members list

Type members

Classlikes

case object AirframeHttpBuildInfo

This object was generated by sbt-buildinfo.

This object was generated by sbt-buildinfo.

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
object Compat

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Compat.type
object EmptyRPCContext extends RPCContext

An empty RPCContext

An empty RPCContext

Attributes

Supertypes
trait RPCContext
class Object
trait Matchable
class Any
Self type
sealed abstract class GrpcStatus(val code: Int, val httpStatus: HttpStatus) extends PackSupport

Attributes

Companion
object
Supertypes
trait PackSupport
class Object
trait Matchable
class Any
Known subtypes
object GrpcStatus

gRPC error code definitions in https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto

Attributes

Companion
class
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
GrpcStatus.type
object Http

An entry point to access airframe-http functionalities

An entry point to access airframe-http functionalities

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Http.type
case class HttpAccessLogConfig(fileName: String, maxFiles: Int, maxSize: Long)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
trait HttpAccessLogWriter extends AutoCloseable

Attributes

Companion
object
Supertypes
trait AutoCloseable
class Object
trait Matchable
class Any
Known subtypes

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
trait HttpBackend[Req, Resp, F[_]]

A base interface to implement http-server specific implementation

A base interface to implement http-server specific implementation

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
Self type
HttpBackend[Req, Resp, F]
object HttpBackend

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
class HttpClientException(val response: HttpResponse[_], val status: HttpStatus, message: String, cause: Throwable) extends Exception

Attributes

Companion
object
Supertypes
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
Known subtypes
object HttpClientException extends LogSupport

Common classifiers for HTTP client responses and exceptions in order to retry HTTP requests.

Common classifiers for HTTP client responses and exceptions in order to retry HTTP requests.

Attributes

Companion
class
Supertypes
trait LogSupport
trait LazyLogger
trait LoggingMethods
trait Serializable
class Object
trait Matchable
class Any
Show all
Self type
case class HttpClientMaxRetryException(response: HttpResponse[_], retryContext: RetryContext, cause: Throwable) extends HttpClientException

Attributes

Supertypes
trait Product
trait Equals
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
trait HttpContext[Req, Resp, F[_]] extends HttpContextBase

Used for passing the subsequent actions to HttpFilter and for defining the leaf action of request processing chain.

Used for passing the subsequent actions to HttpFilter and for defining the leaf action of request processing chain.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class HttpEndpointExecutionContext[Req, Resp, F]
class Context
object HttpContext

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type

A base type to use classOf[HttpContextBase]. classOf[HttpContext[_, _, _] is not supported for higherkinded types

A base type to use classOf[HttpContextBase]. classOf[HttpContext[_, _, _] is not supported for higherkinded types

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait HttpContext[Req, Resp, F]
class HttpEndpointExecutionContext[Req, Resp, F]
class Context
trait HttpFilter[Req, Resp, F[_]] extends HttpFilterType

A filter interface to define actions for handling HTTP requests and responses.

A filter interface to define actions for handling HTTP requests and responses.

Implementations of HttpFilter must wrap an exception occurred in the filter.apply(request, context) with F[_]

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Filter
Self type
HttpFilter[Req, Resp, F]
object HttpFilter

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
HttpFilter.type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait HttpFilter[Req, Resp, F]
class Filter
trait RxHttpFilter
object identity
object HttpHeader

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
HttpHeader.type
trait HttpLogger extends AutoCloseable

Interface for writing HTTP request/response logs

Interface for writing HTTP request/response logs

Attributes

Companion
object
Supertypes
trait AutoCloseable
class Object
trait Matchable
class Any
Known subtypes
object HttpLogger extends LogSupport

Attributes

Companion
trait
Supertypes
trait LogSupport
trait LazyLogger
trait LoggingMethods
trait Serializable
class Object
trait Matchable
class Any
Show all
Self type
HttpLogger.type
case class HttpLoggerConfig(logFileName: String, excludeHeaders: Set[String], extraEntries: () => Map[String, Any], logFilter: (Map[String, Any]) => Map[String, Any], logFormatter: (Map[String, Any]) => String, maxNumFiles: Int, maxFileSize: Long)

Http logger configuration

Http logger configuration

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
trait HttpMessage[Raw] extends HttpMessageBase[Raw]

Attributes

Companion
object
Supertypes
trait HttpMessageBase[Raw]
class Object
trait Matchable
class Any
Known subtypes
class Request
class Response
object HttpMessage

Http request/response data type definitions

Http request/response data type definitions

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
trait HttpMessageBase[Raw]

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait HttpMessage[Raw]
class Request
class Response
object HttpMethod

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
HttpMethod.type
object HttpMultiMap

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class HttpMultiMap(underlying: Map[String, Any])

Immutable case-insensitive MultiMap structure for representing Http headers, query parameters, etc.

Immutable case-insensitive MultiMap structure for representing Http headers, query parameters, etc.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class HttpMultiMapEntry(key: String, value: String)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
trait HttpRequest[Req]

HttpRequest[Req] wraps native request classes (e.g., okhttp's Response, finagle Response, etc.) so that we can implement common logic for various backends.

HttpRequest[Req] wraps native request classes (e.g., okhttp's Response, finagle Response, etc.) so that we can implement common logic for various backends.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait HttpRequestAdapter[Req]

A type class to bridge the original requests and backend-specific request types (e.g., finagle, okhttp, etc.)

A type class to bridge the original requests and backend-specific request types (e.g., finagle, okhttp, etc.)

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait HttpResponse[Resp]

HttpResponse[Resp] wraps native response classes (e.g., okhttp's Response, finagle Response, etc.) so that we can implement common logic for various backends.

HttpResponse[Resp] wraps native response classes (e.g., okhttp's Response, finagle Response, etc.) so that we can implement common logic for various backends.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait HttpResponseAdapter[Resp]

A type class to bridge the original response type and HttpResponse

A type class to bridge the original response type and HttpResponse

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait HttpServer extends AutoCloseable

A common trait for Http server implementations

A common trait for Http server implementations

Attributes

Supertypes
trait AutoCloseable
class Object
trait Matchable
class Any
class HttpServerException(val status: HttpStatus, msg: String, cause: Throwable) extends Exception, HttpServerExceptionBase

Exception to report errors to client

Exception to report errors to client

Attributes

Supertypes
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class HttpStatus(val code: Int) extends PackSupport

Attributes

Companion
object
Supertypes
trait PackSupport
class Object
trait Matchable
class Any
Known subtypes
object Accepted_202
object Conflict_409
object Continue_100
object Created_201
object Forbidden_403
object Found_302
object Gone_410
object Locked_423
object NoContent_204
object NotFound_404
object Ok_200
object SeeOther_303
object Unknown_000
object UseProxy_305
Show all
object HttpStatus

HTTP status code collection.

HTTP status code collection.

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
HttpStatus.type
object RPCContext

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
RPCContext.type
trait RPCContext

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
sealed trait RPCEncoding

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object JSON
object MsgPack
object RPCEncoding

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
case class RPCErrorMessage(code: Int, codeName: String, message: String, stackTrace: Option[Seq[GenericStackTraceElement]], cause: Option[Throwable], appErrorCode: Option[Int], metadata: Map[String, Any])

A model class for RPC error message body. This message will be embedded to HTTP response body or gRPC trailer.

A model class for RPC error message body. This message will be embedded to HTTP response body or gRPC trailer.

We need this class to avoid directly serde RPCException classes with airframe-codec, so that we can properly propagate the exact stack trace to the client.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class RPCException(status: RPCStatus, message: String, cause: Option[Throwable], appErrorCode: Option[Int], metadata: Map[String, Any]) extends Exception, LogSupport

RPCException provides a backend-independent (e.g., Finagle or gRPC) RPC error reporting mechanism. Create this exception with (RPCStatus code).toException(...) method.

RPCException provides a backend-independent (e.g., Finagle or gRPC) RPC error reporting mechanism. Create this exception with (RPCStatus code).toException(...) method.

If necessary, we can add more standard error_details parameter like https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto

Attributes

Companion
object
Supertypes
trait Product
trait Equals
trait LogSupport
trait LazyLogger
trait LoggingMethods
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
object RPCException

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class RPCMethod(path: String, rpcInterfaceName: String, methodName: String, requestSurface: Surface, responseSurface: Surface)

RPC endpoint information

RPC endpoint information

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object RPCStatus

Define the standard RPC code that can be used for generic RPC service implementation.

Define the standard RPC code that can be used for generic RPC service implementation.

This covers all gRPC statuses and have pre-defined mappings to HTTP status (4xx, 5xx) code.

If you need an application-specific error code, use an additional argument of the RPCError class.

Attributes

Companion
class
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
RPCStatus.type
sealed abstract class RPCStatus(val statusType: RPCStatusType, val grpcStatus: GrpcStatus) extends PackSupport

A base class for defining standard RPC error codes

A base class for defining standard RPC error codes

Attributes

Companion
object
Supertypes
trait PackSupport
class Object
trait Matchable
class Any
Known subtypes
sealed trait RPCStatusType extends PackSupport

RPC status types

RPC status types

Attributes

Companion
object
Supertypes
trait PackSupport
class Object
trait Matchable
class Any
Known subtypes
object SUCCESS
object USER_ERROR
object RPCStatusType

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
case class Router(surface: Option[Surface], children: Seq[Router], localRoutes: Seq[Route], filterSurface: Option[Surface], filterInstance: Option[HttpFilterType], controllerInstance: Option[Any]) extends RouterBase, LogSupport

Router defines mappings from HTTP requests to Routes.

Router defines mappings from HTTP requests to Routes.

Router can be nested

  • Router1 with Filter1
    • Router2: endpoints e1, e2
    • Router3: endpoints e3 with Filter2
  • Router4: endpoints e4

From this router definition, the backend HTTP server specific implementation will build a mapping table like this: e1 -> Filter1 andThen process(e1) e2 -> Filter1 andThen process(e2) e3 -> Filter1 andThen Filter2 andThen process(e3) e4 -> process(e4)

Attributes

Companion
object
Supertypes
trait Product
trait Equals
trait LogSupport
trait LazyLogger
trait LoggingMethods
trait Serializable
trait RouterBase
class Object
trait Matchable
class Any
Show all
object Router extends RouterObjectBase, LogSupport

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
trait LogSupport
trait LazyLogger
trait LoggingMethods
trait Serializable
class Object
trait Matchable
class Any
Show all
Self type
Router.type

Rx-based http server backend interface, which will be used for hiding the server implementation detailes between Netty, Finagle, and gRPC

Rx-based http server backend interface, which will be used for hiding the server implementation detailes between Netty, Finagle, and gRPC

Attributes

Supertypes
class Object
trait Matchable
class Any

RxHttpEndpoint is a terminal for processing requests and returns Rx[Response].

RxHttpEndpoint is a terminal for processing requests and returns Rx[Response].

Attributes

Supertypes
class Object
trait Matchable
class Any

An RxHttpFilter is a filter for receiving the response from the endpoint via endpoint.apply(request), and transforming it into another Rx[Response].

An RxHttpFilter is a filter for receiving the response from the endpoint via endpoint.apply(request), and transforming it into another Rx[Response].

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object RxHttpFilter

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class FilterNode
Self type
trait RxRouter

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object RxRouter extends RxRouterObjectBase

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
RxRouter.type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object RxRouter

An interface used for RPC clients (sbt-airframe) to discover the default router for the RPC endpoint.

An interface used for RPC clients (sbt-airframe) to discover the default router for the RPC endpoint.

Example usage:

 import wvlet.airframe.http._

 @RPC
 trait MyRPC {
   def hello(name:String) : String
 }

 object MyRPC extends RxRouterProvider {
   // sbt-airframe will generate an RPC client using this router
   override def router: RxRouter = RxRouter.of[MyRPC]
 }

Attributes

Supertypes
class Object
trait Matchable
class Any
case class ServerAddress(host: String, port: Int, scheme: String)

Server address holder

Server address holder

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object ServerAddress extends LogSupport

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
trait LogSupport
trait LazyLogger
trait LoggingMethods
trait Serializable
class Object
trait Matchable
class Any
Show all
Self type
object StaticContent extends LogSupport

Helper for returning static contents

Helper for returning static contents

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
trait LogSupport
trait LazyLogger
trait LoggingMethods
trait Serializable
class Object
trait Matchable
class Any
Show all
Self type
case class StaticContent(resourcePaths: List[ResourceType])

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Value members

Concrete fields

val compat: CompatApi