package http
- Alphabetic
- By Inheritance
- http
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- trait ChannelConfig extends AnyRef
Contains only http channel related configurations in HttpClientConfig
- trait CompatApi extends AnyRef
An interface for using different implementation between Scala JVM and Scala.js
- trait Endpoint extends Annotation
- Annotations
- @Retention() @Target()
- sealed abstract class GrpcStatus extends PackSupport
- trait HttpBackend[Req, Resp, F[_]] extends AnyRef
A base interface to implement http-server specific implementation
- trait HttpClient[F[_], Req, Resp] extends HttpClientBase[F, Req, Resp] with AutoCloseable
Asynchronous HTTP Client interface
Asynchronous HTTP Client interface
- F
An abstraction for Future type (e.g., Resolves the differences between Twitter Future, Scala Future, etc.)
- trait HttpClientBase[F[_], Req, Resp] extends AnyRef
- case class HttpClientConfig(backend: HttpClientBackend = compat.defaultHttpClientBackend, requestFilter: (Request) => Request = identity, rpcEncoding: RPCEncoding = RPCEncoding.JSON, retryContext: RetryContext = compat.defaultHttpClientBackend.defaultRequestRetryer, codecFactory: MessageCodecFactory = MessageCodecFactory.defaultFactoryForJSON, circuitBreaker: CircuitBreaker = CircuitBreaker.withConsecutiveFailures(5), connectTimeout: Duration = Duration(90, TimeUnit.SECONDS), readTimeout: Duration = Duration(90, TimeUnit.SECONDS), executionContextProvider: (HttpClientConfig) => ExecutionContext = _ => compat.defaultExecutionContext, clientFilter: ClientFilter = ClientFilter.identity, rxConverter: (Future[_]) => RxStream[_] = (f: Future[_]) => // TODO: This execution context needs to reference a global one if we need to use it in Scala JVM Rx.future(f)(compat.defaultExecutionContext)) extends ChannelConfig with Product with Serializable
- class HttpClientException extends Exception
- case class HttpClientMaxRetryException(response: HttpResponse[_], retryContext: RetryContext, cause: Throwable) extends HttpClientException with Product with Serializable
- 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.
- trait HttpContextBase extends AnyRef
A base type to use classOf[HttpContextBase].
A base type to use classOf[HttpContextBase]. classOf[HttpContext[_, _, _] is not supported for higherkinded types
- 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[_]
- trait HttpFilterType extends AnyRef
- trait HttpMessage[Raw] extends HttpMessageBase[Raw]
- trait HttpMessageBase[Raw] extends AnyRef
- case class HttpMultiMap(underlying: Map[String, Any] = Map.empty) extends Product with Serializable
Immutable case-insensitive MultiMap structure for representing Http headers, query parameters, etc.
- case class HttpMultiMapEntry(key: String, value: String) extends Product with Serializable
- trait HttpRequest[Req] extends AnyRef
HttpRequest[Req] wraps native request classes (e.g., okhttp's Response, finagle Response, etc.) so that we can implement common logic for various backends.
- trait HttpRequestAdapter[Req] extends AnyRef
A type class to bridge the original requests and backend-specific request types (e.g., finagle, okhttp, etc.)
- trait HttpResponse[Resp] extends AnyRef
HttpResponse[Resp] wraps native response classes (e.g., okhttp's Response, finagle Response, etc.) so that we can implement common logic for various backends.
- trait HttpResponseAdapter[Resp] extends AnyRef
A type class to bridge the original response type and HttpResponse
- class HttpResponseBodyCodec[Resp] extends MessageCodec[HttpResponse[_]]
- class HttpServerException extends Exception with HttpServerExceptionBase
Exception to report errors to client
- trait HttpServerExceptionBase extends AnyRef
- class HttpStatus extends PackSupport
- trait HttpSyncClient[Req, Resp] extends HttpSyncClientBase[Req, Resp] with AutoCloseable
A synchronous HTTP Client interface
- class HttpSyncClientAdapter[F[_], Req, Resp] extends HttpSyncClientAdapterBase[F, Req, Resp]
A synchronous HttpClient that awaits responses.
- abstract class HttpSyncClientAdapterBase[F[_], Req, Resp] extends HttpSyncClient[Req, Resp]
- trait HttpSyncClientBase[Req, Resp] extends AnyRef
- trait RPC extends Annotation
- Annotations
- @Retention() @Target()
- trait RPCContext extends AnyRef
- sealed trait RPCEncoding extends AnyRef
- case class RPCErrorMessage(code: Int = RPCStatus.UNKNOWN_I1.code, codeName: String = RPCStatus.UNKNOWN_I1.name, message: String = "", stackTrace: Option[Seq[GenericStackTraceElement]] = None, cause: Option[Throwable] = None, appErrorCode: Option[Int] = None, metadata: Map[String, Any] = Map.empty) extends Product with Serializable
A model class for RPC error message body.
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.
- case class RPCException(status: RPCStatus = RPCStatus.INTERNAL_ERROR_I0, message: String = "", cause: Option[Throwable] = None, appErrorCode: Option[Int] = None, metadata: Map[String, Any] = Map.empty) extends Exception with Product with Serializable
RPCException provides a backend-independent (e.g., Finagle or gRPC) RPC error reporting mechanism.
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
- case class RPCMethod(path: String, rpcInterfaceName: String, methodName: String, requestSurface: Surface, responseSurface: Surface) extends Product with Serializable
RPC endpoint information
- sealed abstract class RPCStatus extends PackSupport
A base class for defining standard RPC error codes
- sealed trait RPCStatusType extends PackSupport
RPC status types
- case class ServerAddress(host: String, port: Int, scheme: String = "http") extends Product with Serializable
Server address holder
- trait description extends Annotation
- Annotations
- @Retention() @Target()
Value Members
- val compat: CompatApi
- case object BuildInfo extends Product with Serializable
This object was generated by sbt-buildinfo.
- object EmptyRPCContext extends RPCContext
An empty RPCContext
- object GrpcStatus
gRPC error code definitions in https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto
- object Http
An entry point to access airframe-http functionalities
- object HttpBackend
- object HttpClient extends LogSupport
- object HttpClientConfig extends Serializable
- object HttpClientException extends LogSupport
Common classifiers for HTTP client responses and exceptions in order to retry HTTP requests.
- object HttpContext
- object HttpFilter
- object HttpHeader
- object HttpMessage
Http request/response data type definitions
- object HttpMethod
- object HttpMultiMap extends Serializable
- object HttpMultiMapCodec extends MessageCodec[HttpMultiMap]
- object HttpStatus
HTTP status code collection.
- object RPCContext
- object RPCEncoding
- object RPCException extends Serializable
- 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.
- object RPCStatusType
- object ServerAddress extends LogSupport