-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import java.util.Map.Entry; | ||
import java.util.function.BiConsumer; | ||
import java.lang.Iterable | ||
|
||
trait HttpHeaders extends Iterable[Entry[String, String]] { | ||
def forEach(action: BiConsumer[String, String]): Unit = ??? | ||
} | ||
|
||
@main def Test = | ||
val headers: HttpHeaders = ??? | ||
headers.forEach((a, b) => ???) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import java.util.function.Function | ||
|
||
trait HttpClient | ||
trait HttpRequest | ||
trait HttpResponse | ||
trait ClientRequestContext | ||
|
||
trait DecoratingHttpClientFunction { | ||
def execute(delegate: HttpClient, ctx: ClientRequestContext, req: HttpRequest): HttpResponse | ||
} | ||
|
||
class AbstractClientOptionsBuilder: | ||
def decorator(fn: Function[? <: HttpClient, ? <: HttpClient]): AbstractClientOptionsBuilder = ??? | ||
def decorator(fn: DecoratingHttpClientFunction): AbstractClientOptionsBuilder = ??? | ||
|
||
class WebClientBuilder extends AbstractClientOptionsBuilder: | ||
override def decorator(fn: Function[? <: HttpClient, ? <: HttpClient]): WebClientBuilder = ??? | ||
override def decorator(fn: DecoratingHttpClientFunction): WebClientBuilder = ??? | ||
|
||
class ArmeriaClientBuilder[F[_]]: | ||
type DecoratingFunction = (HttpClient, ClientRequestContext, HttpRequest) => HttpResponse | ||
def clientBuilder: WebClientBuilder = ??? | ||
|
||
def withDecorator(decorator: DecoratingFunction): ArmeriaClientBuilder[F] = { | ||
clientBuilder.decorator(decorator(_, _, _)) | ||
this | ||
} |