wvlet.airframe.http

Attributes

Members list

Type members

Classlikes

case object BuildInfo

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
BuildInfo.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 ABORTED_10.type
object ALREADY_EXISTS_6.type
object CANCELLED_1.type
object DATA_LOSS_15.type
object DEADLINE_EXCEEDED_4.type
object FAILED_PRECONDITION_9.type
object INTERNAL_13.type
object INVALID_ARGUMENT_3.type
object NOT_FOUND_5.type
object OK_0.type
object OUT_OF_RANGE_11.type
object PERMISSION_DENIED_7.type
object RESOURCE_EXHAUSTED_8.type
object UNAUTHENTICATED_16.type
object UNAVAILABLE_14.type
object UNIMPLEMENTED_12.type
object UNKNOWN_2.type
Show all
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
object DefaultBackend.type
Self type
HttpBackend[Req, Resp, F]
object HttpBackend

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
object HttpClient extends LogSupport

Attributes

Companion
trait
Supertypes
trait LogSupport
trait LazyLogger
trait LoggingMethods
trait Serializable
class Object
trait Matchable
class Any
Show all
Self type
HttpClient.type
trait HttpClientBase[F[_], Req, Resp]

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait HttpClient[F, Req, Resp]
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
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], extraTags: 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
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.type
object BadGateway_502.type
object BadRequest_400.type
object Conflict_409.type
object Continue_100.type
object Created_201.type
object EnhanceYourCalm_420.type
object ExpectationFailed_417.type
object FailedDependency_424.type
object Forbidden_403.type
object Found_302.type
object GatewayTimeout_504.type
object Gone_410.type
object LengthRequired_411.type
object Locked_423.type
object MethodNotAllowed_405.type
object MovedPermanently_301.type
object MultiStatus_207.type
object MultipleChoices_300.type
object NoContent_204.type
object NotAcceptable_406.type
object NotExtended_510.type
object NotFound_404.type
object NotImplemented_501.type
object NotModified_304.type
object Ok_200.type
object PartialContent_206.type
object PaymentRequired_402.type
object PermanentRedirect_308.type
object Processing_102.type
object RequestTimeout_408.type
object RequestURITooLong_414.type
object ResetContent_205.type
object SeeOther_303.type
object TemporaryRedirect_307.type
object TooManyRequests_429.type
object Unauthorized_401.type
object Unknown_000.type
object UpgradeRequired_426.type
object UseProxy_305.type
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
trait HttpSyncClient[Req, Resp] extends HttpSyncClientBase[Req, Resp], AutoCloseable

A synchronous HTTP Client interface

A synchronous HTTP Client interface

Attributes

Supertypes
trait AutoCloseable
trait HttpSyncClientBase[Req, Resp]
class Object
trait Matchable
class Any
Known subtypes
class HttpSyncClientAdapterBase[F, Req, Resp]
class HttpSyncClientAdapter[F, Req, Resp]
class HttpSyncClientAdapter[F[_], Req, Resp](asyncClient: HttpClient[F, Req, Resp]) extends HttpSyncClientAdapterBase[F, Req, Resp]

A synchronous HttpClient that awaits responses.

A synchronous HttpClient that awaits responses.

Attributes

Supertypes
class HttpSyncClientAdapterBase[F, Req, Resp]
trait HttpSyncClient[Req, Resp]
trait AutoCloseable
trait HttpSyncClientBase[Req, Resp]
class Object
trait Matchable
class Any
Show all
abstract class HttpSyncClientAdapterBase[F[_], Req, Resp](asyncClient: HttpClient[F, Req, Resp]) extends HttpSyncClient[Req, Resp]

Attributes

Supertypes
trait HttpSyncClient[Req, Resp]
trait AutoCloseable
trait HttpSyncClientBase[Req, Resp]
class Object
trait Matchable
class Any
Show all
Known subtypes
class HttpSyncClientAdapter[F, Req, Resp]
trait HttpSyncClientBase[Req, Resp]

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait HttpSyncClient[Req, Resp]
class HttpSyncClientAdapterBase[F, Req, Resp]
class HttpSyncClientAdapter[F, Req, Resp]
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
object EmptyRPCContext.type
sealed trait RPCEncoding

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object JSON.type
object MsgPack.type
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
object ABORTED_U12.type
object ALREADY_EXISTS_U6.type
object CANCELLED_U11.type
object DATA_LOSS_I8.type
object DEADLINE_EXCEEDED_I4.type
object EXCEEDED_BUDGET_R8.type
object EXCEEDED_CPU_LIMIT_R3.type
object INTERNAL_ERROR_I0.type
object INTERRUPTED_I5.type
object INVALID_ARGUMENT_U2.type
object INVALID_REQUEST_U1.type
object NOT_FOUND_U5.type
object NOT_SUPPORTED_U7.type
object OUT_OF_MEMORY_R1.type
object OUT_OF_RANGE_U4.type
object PERMISSION_DENIED_U14.type
object RESOURCE_EXHAUSTED_R0.type
object SUCCESS_S0.type
object SYNTAX_ERROR_U3.type
object TIMEOUT_I3.type
object UNAUTHENTICATED_U13.type
object UNAVAILABLE_I2.type
object UNEXPECTED_STATE_U9.type
object UNIMPLEMENTED_U8.type
object UNKNOWN_I1.type
object USER_ERROR_U0.type
Show all
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 INTERNAL_ERROR.type
object RESOURCE_EXHAUSTED.type
object SUCCESS.type
object USER_ERROR.type
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
trait RxHttpFilter

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 RPCResponseFilter.type
object identity.type
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.type

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

Deprecated classlikes

trait HttpClient[F[_], Req, Resp] extends HttpClientBase[F, Req, Resp], AutoCloseable

Asynchronous HTTP Client interface

Asynchronous HTTP Client interface

Type parameters

F

An abstraction for Future type (e.g., Resolves the differences between Twitter Future, Scala Future, etc.)

Attributes

Companion
object
Deprecated
true
Supertypes
trait AutoCloseable
trait HttpClientBase[F, Req, Resp]
class Object
trait Matchable
class Any

Value members

Concrete fields

val compat: CompatApi